// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate gtype;
extern crate iam_v1;
extern crate lazy_static;
extern crate location;
extern crate reqwest;
extern crate rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Describes encryption state of a resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataEncryptionState {
    /// Required. The KMS key version name with which data of a resource is
    /// encrypted.
    pub kms_key_version_name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DataEncryptionState {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [kms_key_version_name][crate::model::DataEncryptionState::kms_key_version_name].
    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.kms_key_version_name = v.into();
        self
    }
}

impl wkt::message::Message for DataEncryptionState {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DataEncryptionState"
    }
}

/// Represents a Dataform Git repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Repository {
    /// Identifier. The repository's name.
    pub name: std::string::String,

    /// Output only. The timestamp of when the repository was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The repository's user-friendly name.
    pub display_name: std::string::String,

    /// Optional. If set, configures this repository to be linked to a Git remote.
    pub git_remote_settings: std::option::Option<crate::model::repository::GitRemoteSettings>,

    /// Optional. The name of the Secret Manager secret version to be used to
    /// interpolate variables into the .npmrc file for package installation
    /// operations. Must be in the format `projects/*/secrets/*/versions/*`. The
    /// file itself must be in a JSON format.
    pub npmrc_environment_variables_secret_version: std::string::String,

    /// Optional. If set, fields of `workspace_compilation_overrides` override the
    /// default compilation settings that are specified in dataform.json when
    /// creating workspace-scoped compilation results. See documentation for
    /// `WorkspaceCompilationOverrides` for more information.
    pub workspace_compilation_overrides:
        std::option::Option<crate::model::repository::WorkspaceCompilationOverrides>,

    /// Optional. Repository user labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. Input only. If set to true, the authenticated user will be
    /// granted the roles/dataform.admin role on the created repository.
    pub set_authenticated_user_admin: bool,

    /// Optional. The service account to run workflow invocations under.
    pub service_account: std::string::String,

    /// Optional. The reference to a KMS encryption key. If provided, it will be
    /// used to encrypt user data in the repository and all child resources. It is
    /// not possible to add or update the encryption key after the repository is
    /// created. Example:
    /// `projects/{kms_project}/locations/{location}/keyRings/{key_location}/cryptoKeys/{key}`
    pub kms_key_name: std::string::String,

    /// Output only. A data encryption state of a Git repository if this Repository
    /// is protected by a KMS key.
    pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Repository {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Repository::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Repository::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [display_name][crate::model::Repository::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
    pub fn set_git_remote_settings<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
    {
        self.git_remote_settings = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
    pub fn set_or_clear_git_remote_settings<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
    {
        self.git_remote_settings = v.map(|x| x.into());
        self
    }

    /// Sets the value of [npmrc_environment_variables_secret_version][crate::model::Repository::npmrc_environment_variables_secret_version].
    pub fn set_npmrc_environment_variables_secret_version<
        T: std::convert::Into<std::string::String>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.npmrc_environment_variables_secret_version = v.into();
        self
    }

    /// Sets the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
    pub fn set_workspace_compilation_overrides<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
    {
        self.workspace_compilation_overrides = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
    pub fn set_or_clear_workspace_compilation_overrides<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
    {
        self.workspace_compilation_overrides = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Repository::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [set_authenticated_user_admin][crate::model::Repository::set_authenticated_user_admin].
    pub fn set_set_authenticated_user_admin<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.set_authenticated_user_admin = v.into();
        self
    }

    /// Sets the value of [service_account][crate::model::Repository::service_account].
    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_account = v.into();
        self
    }

    /// Sets the value of [kms_key_name][crate::model::Repository::kms_key_name].
    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kms_key_name = v.into();
        self
    }

    /// Sets the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
    pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
    pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [internal_metadata][crate::model::Repository::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::Repository::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Repository {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.Repository"
    }
}

/// Defines additional types related to [Repository].
pub mod repository {
    #[allow(unused_imports)]
    use super::*;

    /// Controls Git remote configuration for a repository.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct GitRemoteSettings {
        /// Required. The Git remote's URL.
        pub url: std::string::String,

        /// Required. The Git remote's default branch name.
        pub default_branch: std::string::String,

        /// Optional. The name of the Secret Manager secret version to use as an
        /// authentication token for Git operations. Must be in the format
        /// `projects/*/secrets/*/versions/*`.
        pub authentication_token_secret_version: std::string::String,

        /// Optional. Authentication fields for remote uris using SSH protocol.
        pub ssh_authentication_config: std::option::Option<
            crate::model::repository::git_remote_settings::SshAuthenticationConfig,
        >,

        /// Output only. Deprecated: The field does not contain any token status
        /// information.
        #[deprecated]
        pub token_status: crate::model::repository::git_remote_settings::TokenStatus,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl GitRemoteSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [url][crate::model::repository::GitRemoteSettings::url].
        pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.url = v.into();
            self
        }

        /// Sets the value of [default_branch][crate::model::repository::GitRemoteSettings::default_branch].
        pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.default_branch = v.into();
            self
        }

        /// Sets the value of [authentication_token_secret_version][crate::model::repository::GitRemoteSettings::authentication_token_secret_version].
        pub fn set_authentication_token_secret_version<
            T: std::convert::Into<std::string::String>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.authentication_token_secret_version = v.into();
            self
        }

        /// Sets the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
        pub fn set_ssh_authentication_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<
                    crate::model::repository::git_remote_settings::SshAuthenticationConfig,
                >,
        {
            self.ssh_authentication_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
        pub fn set_or_clear_ssh_authentication_config<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<
                    crate::model::repository::git_remote_settings::SshAuthenticationConfig,
                >,
        {
            self.ssh_authentication_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [token_status][crate::model::repository::GitRemoteSettings::token_status].
        #[deprecated]
        pub fn set_token_status<
            T: std::convert::Into<crate::model::repository::git_remote_settings::TokenStatus>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.token_status = v.into();
            self
        }
    }

    impl wkt::message::Message for GitRemoteSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings"
        }
    }

    /// Defines additional types related to [GitRemoteSettings].
    pub mod git_remote_settings {
        #[allow(unused_imports)]
        use super::*;

        /// Configures fields for performing SSH authentication.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct SshAuthenticationConfig {
            /// Required. The name of the Secret Manager secret version to use as a
            /// ssh private key for Git operations.
            /// Must be in the format `projects/*/secrets/*/versions/*`.
            pub user_private_key_secret_version: std::string::String,

            /// Required. Content of a public SSH key to verify an identity of a remote
            /// Git host.
            pub host_public_key: std::string::String,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl SshAuthenticationConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [user_private_key_secret_version][crate::model::repository::git_remote_settings::SshAuthenticationConfig::user_private_key_secret_version].
            pub fn set_user_private_key_secret_version<
                T: std::convert::Into<std::string::String>,
            >(
                mut self,
                v: T,
            ) -> Self {
                self.user_private_key_secret_version = v.into();
                self
            }

            /// Sets the value of [host_public_key][crate::model::repository::git_remote_settings::SshAuthenticationConfig::host_public_key].
            pub fn set_host_public_key<T: std::convert::Into<std::string::String>>(
                mut self,
                v: T,
            ) -> Self {
                self.host_public_key = v.into();
                self
            }
        }

        impl wkt::message::Message for SshAuthenticationConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings.SshAuthenticationConfig"
            }
        }

        /// The status of the authentication token.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum TokenStatus {
            /// Default value. This value is unused.
            Unspecified,
            /// The token could not be found in Secret Manager (or the Dataform
            /// Service Account did not have permission to access it).
            NotFound,
            /// The token could not be used to authenticate against the Git remote.
            Invalid,
            /// The token was used successfully to authenticate against the Git remote.
            Valid,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [TokenStatus::value] or
            /// [TokenStatus::name].
            UnknownValue(token_status::UnknownValue),
        }

        #[doc(hidden)]
        pub mod token_status {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl TokenStatus {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::NotFound => std::option::Option::Some(1),
                    Self::Invalid => std::option::Option::Some(2),
                    Self::Valid => std::option::Option::Some(3),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
                    Self::NotFound => std::option::Option::Some("NOT_FOUND"),
                    Self::Invalid => std::option::Option::Some("INVALID"),
                    Self::Valid => std::option::Option::Some("VALID"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for TokenStatus {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for TokenStatus {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for TokenStatus {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::NotFound,
                    2 => Self::Invalid,
                    3 => Self::Valid,
                    _ => Self::UnknownValue(token_status::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for TokenStatus {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
                    "NOT_FOUND" => Self::NotFound,
                    "INVALID" => Self::Invalid,
                    "VALID" => Self::Valid,
                    _ => Self::UnknownValue(token_status::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for TokenStatus {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::NotFound => serializer.serialize_i32(1),
                    Self::Invalid => serializer.serialize_i32(2),
                    Self::Valid => serializer.serialize_i32(3),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for TokenStatus {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
                    ".google.cloud.dataform.v1.Repository.GitRemoteSettings.TokenStatus",
                ))
            }
        }
    }

    /// Configures workspace compilation overrides for a repository.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct WorkspaceCompilationOverrides {
        /// Optional. The default database (Google Cloud project ID).
        pub default_database: std::string::String,

        /// Optional. The suffix that should be appended to all schema (BigQuery
        /// dataset ID) names.
        pub schema_suffix: std::string::String,

        /// Optional. The prefix that should be prepended to all table names.
        pub table_prefix: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl WorkspaceCompilationOverrides {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [default_database][crate::model::repository::WorkspaceCompilationOverrides::default_database].
        pub fn set_default_database<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.default_database = v.into();
            self
        }

        /// Sets the value of [schema_suffix][crate::model::repository::WorkspaceCompilationOverrides::schema_suffix].
        pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.schema_suffix = v.into();
            self
        }

        /// Sets the value of [table_prefix][crate::model::repository::WorkspaceCompilationOverrides::table_prefix].
        pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.table_prefix = v.into();
            self
        }
    }

    impl wkt::message::Message for WorkspaceCompilationOverrides {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.Repository.WorkspaceCompilationOverrides"
        }
    }
}

/// `ListRepositories` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRepositoriesRequest {
    /// Required. The location in which to list repositories. Must be in the format
    /// `projects/*/locations/*`.
    pub parent: std::string::String,

    /// Optional. Maximum number of repositories to return. The server may return
    /// fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `ListRepositories` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListRepositories`,
    /// with the exception of `page_size`, must match the call that provided the
    /// page token.
    pub page_token: std::string::String,

    /// Optional. This field only supports ordering by `name`. If unspecified, the
    /// server will choose the ordering. If specified, the default order is
    /// ascending for the `name` field.
    pub order_by: std::string::String,

    /// Optional. Filter for the returned list.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRepositoriesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListRepositoriesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListRepositoriesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesRequest"
    }
}

/// `ListRepositories` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRepositoriesResponse {
    /// List of repositories.
    pub repositories: std::vec::Vec<crate::model::Repository>,

    /// A token which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations which could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRepositoriesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
    pub fn set_repositories<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Repository>,
    {
        use std::iter::Iterator;
        self.repositories = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListRepositoriesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListRepositoriesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
    type PageItem = crate::model::Repository;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.repositories
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// `GetRepository` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRepositoryRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.GetRepositoryRequest"
    }
}

/// `CreateRepository` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRepositoryRequest {
    /// Required. The location in which to create the repository. Must be in the
    /// format `projects/*/locations/*`.
    pub parent: std::string::String,

    /// Required. The repository to create.
    pub repository: std::option::Option<crate::model::Repository>,

    /// Required. The ID to use for the repository, which will become the final
    /// component of the repository's resource name.
    pub repository_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
    pub fn set_repository<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = v.map(|x| x.into());
        self
    }

    /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
    pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.repository_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CreateRepositoryRequest"
    }
}

/// `UpdateRepository` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRepositoryRequest {
    /// Optional. Specifies the fields to be updated in the repository. If left
    /// unset, all fields will be updated.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The repository to update.
    pub repository: std::option::Option<crate::model::Repository>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
    pub fn set_repository<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.UpdateRepositoryRequest"
    }
}

/// `DeleteRepository` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRepositoryRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    /// Optional. If set to true, any child resources of this repository will also
    /// be deleted. (Otherwise, the request will only succeed if the repository has
    /// no child resources.)
    pub force: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [force][crate::model::DeleteRepositoryRequest::force].
    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.force = v.into();
        self
    }
}

impl wkt::message::Message for DeleteRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DeleteRepositoryRequest"
    }
}

/// `CommitRepositoryChanges` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitRepositoryChangesRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    /// Required. The changes to commit to the repository.
    pub commit_metadata: std::option::Option<crate::model::CommitMetadata>,

    /// Optional. The commit SHA which must be the repository's current HEAD before
    /// applying this commit; otherwise this request will fail. If unset, no
    /// validation on the current HEAD commit SHA is performed.
    pub required_head_commit_sha: std::string::String,

    /// Optional. A map to the path of the file to the operation. The path is the
    /// full file path including filename, from repository root.
    pub file_operations: std::collections::HashMap<
        std::string::String,
        crate::model::commit_repository_changes_request::FileOperation,
    >,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommitRepositoryChangesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::CommitRepositoryChangesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
    pub fn set_commit_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommitMetadata>,
    {
        self.commit_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
    pub fn set_or_clear_commit_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommitMetadata>,
    {
        self.commit_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [required_head_commit_sha][crate::model::CommitRepositoryChangesRequest::required_head_commit_sha].
    pub fn set_required_head_commit_sha<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.required_head_commit_sha = v.into();
        self
    }

    /// Sets the value of [file_operations][crate::model::CommitRepositoryChangesRequest::file_operations].
    pub fn set_file_operations<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::commit_repository_changes_request::FileOperation>,
    {
        use std::iter::Iterator;
        self.file_operations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for CommitRepositoryChangesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest"
    }
}

/// Defines additional types related to [CommitRepositoryChangesRequest].
pub mod commit_repository_changes_request {
    #[allow(unused_imports)]
    use super::*;

    /// Represents a single file operation to the repository.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct FileOperation {
        /// The operation to perform on the file.
        pub operation: std::option::Option<
            crate::model::commit_repository_changes_request::file_operation::Operation,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl FileOperation {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation].
        ///
        /// Note that all the setters affecting `operation` are mutually
        /// exclusive.
        pub fn set_operation<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::commit_repository_changes_request::file_operation::Operation,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.operation = v.into();
            self
        }

        /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
        /// if it holds a `WriteFile`, `None` if the field is not set or
        /// holds a different branch.
        pub fn write_file(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<
                crate::model::commit_repository_changes_request::file_operation::WriteFile,
            >,
        > {
            #[allow(unreachable_patterns)]
            self.operation.as_ref().and_then(|v| match v {
                crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
        /// to hold a `WriteFile`.
        ///
        /// Note that all the setters affecting `operation` are
        /// mutually exclusive.
        pub fn set_write_file<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::commit_repository_changes_request::file_operation::WriteFile,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.operation = std::option::Option::Some(
                crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(
                    v.into()
                )
            );
            self
        }

        /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
        /// if it holds a `DeleteFile`, `None` if the field is not set or
        /// holds a different branch.
        pub fn delete_file(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<
                crate::model::commit_repository_changes_request::file_operation::DeleteFile,
            >,
        > {
            #[allow(unreachable_patterns)]
            self.operation.as_ref().and_then(|v| match v {
                crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
        /// to hold a `DeleteFile`.
        ///
        /// Note that all the setters affecting `operation` are
        /// mutually exclusive.
        pub fn set_delete_file<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::commit_repository_changes_request::file_operation::DeleteFile,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.operation = std::option::Option::Some(
                crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(
                    v.into()
                )
            );
            self
        }
    }

    impl wkt::message::Message for FileOperation {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation"
        }
    }

    /// Defines additional types related to [FileOperation].
    pub mod file_operation {
        #[allow(unused_imports)]
        use super::*;

        /// Represents the write file operation (for files added or modified).
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct WriteFile {
            /// The file's contents.
            pub contents: ::bytes::Bytes,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl WriteFile {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [contents][crate::model::commit_repository_changes_request::file_operation::WriteFile::contents].
            pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
                self.contents = v.into();
                self
            }
        }

        impl wkt::message::Message for WriteFile {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.WriteFile"
            }
        }

        /// Represents the delete file operation.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct DeleteFile {
            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl DeleteFile {
            pub fn new() -> Self {
                std::default::Default::default()
            }
        }

        impl wkt::message::Message for DeleteFile {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.DeleteFile"
            }
        }

        /// The operation to perform on the file.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Operation {
            /// Represents the write operation.
            WriteFile(
                std::boxed::Box<
                    crate::model::commit_repository_changes_request::file_operation::WriteFile,
                >,
            ),
            /// Represents the delete operation.
            DeleteFile(
                std::boxed::Box<
                    crate::model::commit_repository_changes_request::file_operation::DeleteFile,
                >,
            ),
        }
    }
}

/// `CommitRepositoryChanges` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitRepositoryChangesResponse {
    /// The commit SHA of the current commit.
    pub commit_sha: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommitRepositoryChangesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [commit_sha][crate::model::CommitRepositoryChangesResponse::commit_sha].
    pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.commit_sha = v.into();
        self
    }
}

impl wkt::message::Message for CommitRepositoryChangesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesResponse"
    }
}

/// `ReadRepositoryFile` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReadRepositoryFileRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    /// Optional. The commit SHA for the commit to read from. If unset, the file
    /// will be read from HEAD.
    pub commit_sha: std::string::String,

    /// Required. Full file path to read including filename, from repository root.
    pub path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ReadRepositoryFileRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ReadRepositoryFileRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [commit_sha][crate::model::ReadRepositoryFileRequest::commit_sha].
    pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.commit_sha = v.into();
        self
    }

    /// Sets the value of [path][crate::model::ReadRepositoryFileRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }
}

impl wkt::message::Message for ReadRepositoryFileRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileRequest"
    }
}

/// `ReadRepositoryFile` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReadRepositoryFileResponse {
    /// The file's contents.
    pub contents: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ReadRepositoryFileResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [contents][crate::model::ReadRepositoryFileResponse::contents].
    pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.contents = v.into();
        self
    }
}

impl wkt::message::Message for ReadRepositoryFileResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileResponse"
    }
}

/// `QueryRepositoryDirectoryContents` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryRepositoryDirectoryContentsRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    /// Optional. The Commit SHA for the commit to query from. If unset, the
    /// directory will be queried from HEAD.
    pub commit_sha: std::string::String,

    /// Optional. The directory's full path including directory name, relative to
    /// root. If left unset, the root is used.
    pub path: std::string::String,

    /// Optional. Maximum number of paths to return. The server may return fewer
    /// items than requested. If unspecified, the server will pick an appropriate
    /// default.
    pub page_size: i32,

    /// Optional. Page token received from a previous
    /// `QueryRepositoryDirectoryContents` call. Provide this to retrieve the
    /// subsequent page.
    ///
    /// When paginating, all other parameters provided to
    /// `QueryRepositoryDirectoryContents`, with the exception of `page_size`, must
    /// match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryRepositoryDirectoryContentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::QueryRepositoryDirectoryContentsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [commit_sha][crate::model::QueryRepositoryDirectoryContentsRequest::commit_sha].
    pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.commit_sha = v.into();
        self
    }

    /// Sets the value of [path][crate::model::QueryRepositoryDirectoryContentsRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::QueryRepositoryDirectoryContentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::QueryRepositoryDirectoryContentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryRepositoryDirectoryContentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsRequest"
    }
}

/// `QueryRepositoryDirectoryContents` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryRepositoryDirectoryContentsResponse {
    /// List of entries in the directory.
    pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryRepositoryDirectoryContentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [directory_entries][crate::model::QueryRepositoryDirectoryContentsResponse::directory_entries].
    pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DirectoryEntry>,
    {
        use std::iter::Iterator;
        self.directory_entries = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::QueryRepositoryDirectoryContentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryRepositoryDirectoryContentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for QueryRepositoryDirectoryContentsResponse {
    type PageItem = crate::model::DirectoryEntry;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.directory_entries
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// `FetchRepositoryHistory` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchRepositoryHistoryRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    /// Optional. Maximum number of commits to return. The server may return fewer
    /// items than requested. If unspecified, the server will pick an appropriate
    /// default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `FetchRepositoryHistory`
    /// call. Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `FetchRepositoryHistory`,
    /// with the exception of `page_size`, must match the call that provided the
    /// page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchRepositoryHistoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::FetchRepositoryHistoryRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::FetchRepositoryHistoryRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::FetchRepositoryHistoryRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for FetchRepositoryHistoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryRequest"
    }
}

/// `FetchRepositoryHistory` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchRepositoryHistoryResponse {
    /// A list of commit logs, ordered by 'git log' default order.
    pub commits: std::vec::Vec<crate::model::CommitLogEntry>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchRepositoryHistoryResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [commits][crate::model::FetchRepositoryHistoryResponse::commits].
    pub fn set_commits<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::CommitLogEntry>,
    {
        use std::iter::Iterator;
        self.commits = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::FetchRepositoryHistoryResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for FetchRepositoryHistoryResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for FetchRepositoryHistoryResponse {
    type PageItem = crate::model::CommitLogEntry;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.commits
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Represents a single commit log.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitLogEntry {
    /// Commit timestamp.
    pub commit_time: std::option::Option<wkt::Timestamp>,

    /// The commit SHA for this commit log entry.
    pub commit_sha: std::string::String,

    /// The commit author for this commit log entry.
    pub author: std::option::Option<crate::model::CommitAuthor>,

    /// The commit message for this commit log entry.
    pub commit_message: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommitLogEntry {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [commit_time][crate::model::CommitLogEntry::commit_time].
    pub fn set_commit_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.commit_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [commit_time][crate::model::CommitLogEntry::commit_time].
    pub fn set_or_clear_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.commit_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [commit_sha][crate::model::CommitLogEntry::commit_sha].
    pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.commit_sha = v.into();
        self
    }

    /// Sets the value of [author][crate::model::CommitLogEntry::author].
    pub fn set_author<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [author][crate::model::CommitLogEntry::author].
    pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = v.map(|x| x.into());
        self
    }

    /// Sets the value of [commit_message][crate::model::CommitLogEntry::commit_message].
    pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.commit_message = v.into();
        self
    }
}

impl wkt::message::Message for CommitLogEntry {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CommitLogEntry"
    }
}

/// Represents a Dataform Git commit.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitMetadata {
    /// Required. The commit's author.
    pub author: std::option::Option<crate::model::CommitAuthor>,

    /// Optional. The commit's message.
    pub commit_message: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommitMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [author][crate::model::CommitMetadata::author].
    pub fn set_author<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [author][crate::model::CommitMetadata::author].
    pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = v.map(|x| x.into());
        self
    }

    /// Sets the value of [commit_message][crate::model::CommitMetadata::commit_message].
    pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.commit_message = v.into();
        self
    }
}

impl wkt::message::Message for CommitMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CommitMetadata"
    }
}

/// `ComputeRepositoryAccessTokenStatus` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeRepositoryAccessTokenStatusRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ComputeRepositoryAccessTokenStatusRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ComputeRepositoryAccessTokenStatusRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for ComputeRepositoryAccessTokenStatusRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusRequest"
    }
}

/// `ComputeRepositoryAccessTokenStatus` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeRepositoryAccessTokenStatusResponse {
    /// Indicates the status of the Git access token.
    pub token_status: crate::model::compute_repository_access_token_status_response::TokenStatus,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ComputeRepositoryAccessTokenStatusResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [token_status][crate::model::ComputeRepositoryAccessTokenStatusResponse::token_status].
    pub fn set_token_status<
        T: std::convert::Into<
                crate::model::compute_repository_access_token_status_response::TokenStatus,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.token_status = v.into();
        self
    }
}

impl wkt::message::Message for ComputeRepositoryAccessTokenStatusResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse"
    }
}

/// Defines additional types related to [ComputeRepositoryAccessTokenStatusResponse].
pub mod compute_repository_access_token_status_response {
    #[allow(unused_imports)]
    use super::*;

    /// Indicates the status of a Git authentication token.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum TokenStatus {
        /// Default value. This value is unused.
        Unspecified,
        /// The token could not be found in Secret Manager (or the Dataform
        /// Service Account did not have permission to access it).
        NotFound,
        /// The token could not be used to authenticate against the Git remote.
        Invalid,
        /// The token was used successfully to authenticate against the Git remote.
        Valid,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [TokenStatus::value] or
        /// [TokenStatus::name].
        UnknownValue(token_status::UnknownValue),
    }

    #[doc(hidden)]
    pub mod token_status {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl TokenStatus {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::NotFound => std::option::Option::Some(1),
                Self::Invalid => std::option::Option::Some(2),
                Self::Valid => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
                Self::NotFound => std::option::Option::Some("NOT_FOUND"),
                Self::Invalid => std::option::Option::Some("INVALID"),
                Self::Valid => std::option::Option::Some("VALID"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for TokenStatus {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for TokenStatus {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for TokenStatus {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::NotFound,
                2 => Self::Invalid,
                3 => Self::Valid,
                _ => Self::UnknownValue(token_status::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for TokenStatus {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
                "NOT_FOUND" => Self::NotFound,
                "INVALID" => Self::Invalid,
                "VALID" => Self::Valid,
                _ => Self::UnknownValue(token_status::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for TokenStatus {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::NotFound => serializer.serialize_i32(1),
                Self::Invalid => serializer.serialize_i32(2),
                Self::Valid => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for TokenStatus {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
                ".google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse.TokenStatus",
            ))
        }
    }
}

/// `FetchRemoteBranches` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchRemoteBranchesRequest {
    /// Required. The repository's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchRemoteBranchesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::FetchRemoteBranchesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for FetchRemoteBranchesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesRequest"
    }
}

/// `FetchRemoteBranches` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchRemoteBranchesResponse {
    /// The remote repository's branch names.
    pub branches: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchRemoteBranchesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [branches][crate::model::FetchRemoteBranchesResponse::branches].
    pub fn set_branches<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.branches = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for FetchRemoteBranchesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesResponse"
    }
}

/// Represents a Dataform Git workspace.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Workspace {
    /// Identifier. The workspace's name.
    pub name: std::string::String,

    /// Output only. The timestamp of when the workspace was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. A data encryption state of a Git repository if this Workspace
    /// is protected by a KMS key.
    pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Workspace {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Workspace::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Workspace::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Workspace::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
    pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
    pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [internal_metadata][crate::model::Workspace::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::Workspace::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Workspace {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.Workspace"
    }
}

/// `ListWorkspaces` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkspacesRequest {
    /// Required. The repository in which to list workspaces. Must be in the
    /// format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Optional. Maximum number of workspaces to return. The server may return
    /// fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `ListWorkspaces` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListWorkspaces`, with
    /// the exception of `page_size`, must match the call that provided the page
    /// token.
    pub page_token: std::string::String,

    /// Optional. This field only supports ordering by `name`. If unspecified, the
    /// server will choose the ordering. If specified, the default order is
    /// ascending for the `name` field.
    pub order_by: std::string::String,

    /// Optional. Filter for the returned list.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkspacesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListWorkspacesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListWorkspacesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListWorkspacesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListWorkspacesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListWorkspacesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListWorkspacesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesRequest"
    }
}

/// `ListWorkspaces` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkspacesResponse {
    /// List of workspaces.
    pub workspaces: std::vec::Vec<crate::model::Workspace>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations which could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkspacesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspaces][crate::model::ListWorkspacesResponse::workspaces].
    pub fn set_workspaces<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Workspace>,
    {
        use std::iter::Iterator;
        self.workspaces = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListWorkspacesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListWorkspacesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListWorkspacesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListWorkspacesResponse {
    type PageItem = crate::model::Workspace;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.workspaces
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// `GetWorkspace` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWorkspaceRequest {
    /// Required. The workspace's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetWorkspaceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetWorkspaceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetWorkspaceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.GetWorkspaceRequest"
    }
}

/// `CreateWorkspace` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkspaceRequest {
    /// Required. The repository in which to create the workspace. Must be in the
    /// format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Required. The workspace to create.
    pub workspace: std::option::Option<crate::model::Workspace>,

    /// Required. The ID to use for the workspace, which will become the final
    /// component of the workspace's resource name.
    pub workspace_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateWorkspaceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateWorkspaceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
    pub fn set_workspace<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Workspace>,
    {
        self.workspace = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
    pub fn set_or_clear_workspace<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Workspace>,
    {
        self.workspace = v.map(|x| x.into());
        self
    }

    /// Sets the value of [workspace_id][crate::model::CreateWorkspaceRequest::workspace_id].
    pub fn set_workspace_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateWorkspaceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CreateWorkspaceRequest"
    }
}

/// `DeleteWorkspace` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkspaceRequest {
    /// Required. The workspace resource's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteWorkspaceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteWorkspaceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteWorkspaceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkspaceRequest"
    }
}

/// Represents the author of a Git commit.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitAuthor {
    /// Required. The commit author's name.
    pub name: std::string::String,

    /// Required. The commit author's email address.
    pub email_address: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommitAuthor {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::CommitAuthor::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [email_address][crate::model::CommitAuthor::email_address].
    pub fn set_email_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.email_address = v.into();
        self
    }
}

impl wkt::message::Message for CommitAuthor {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CommitAuthor"
    }
}

/// `PullGitCommits` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PullGitCommitsRequest {
    /// Required. The workspace's name.
    pub name: std::string::String,

    /// Optional. The name of the branch in the Git remote from which to pull
    /// commits. If left unset, the repository's default branch name will be used.
    pub remote_branch: std::string::String,

    /// Required. The author of any merge commit which may be created as a result
    /// of merging fetched Git commits into this workspace.
    pub author: std::option::Option<crate::model::CommitAuthor>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PullGitCommitsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PullGitCommitsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [remote_branch][crate::model::PullGitCommitsRequest::remote_branch].
    pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.remote_branch = v.into();
        self
    }

    /// Sets the value of [author][crate::model::PullGitCommitsRequest::author].
    pub fn set_author<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [author][crate::model::PullGitCommitsRequest::author].
    pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for PullGitCommitsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsRequest"
    }
}

/// `PullGitCommits` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PullGitCommitsResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PullGitCommitsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for PullGitCommitsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsResponse"
    }
}

/// `PushGitCommits` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PushGitCommitsRequest {
    /// Required. The workspace's name.
    pub name: std::string::String,

    /// Optional. The name of the branch in the Git remote to which commits should
    /// be pushed. If left unset, the repository's default branch name will be
    /// used.
    pub remote_branch: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PushGitCommitsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PushGitCommitsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [remote_branch][crate::model::PushGitCommitsRequest::remote_branch].
    pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.remote_branch = v.into();
        self
    }
}

impl wkt::message::Message for PushGitCommitsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsRequest"
    }
}

/// `PushGitCommits` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PushGitCommitsResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PushGitCommitsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for PushGitCommitsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsResponse"
    }
}

/// `FetchFileGitStatuses` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchFileGitStatusesRequest {
    /// Required. The workspace's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchFileGitStatusesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::FetchFileGitStatusesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for FetchFileGitStatusesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesRequest"
    }
}

/// `FetchFileGitStatuses` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchFileGitStatusesResponse {
    /// A list of all files which have uncommitted Git changes. There will only be
    /// a single entry for any given file.
    pub uncommitted_file_changes:
        std::vec::Vec<crate::model::fetch_file_git_statuses_response::UncommittedFileChange>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchFileGitStatusesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uncommitted_file_changes][crate::model::FetchFileGitStatusesResponse::uncommitted_file_changes].
    pub fn set_uncommitted_file_changes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<
                crate::model::fetch_file_git_statuses_response::UncommittedFileChange,
            >,
    {
        use std::iter::Iterator;
        self.uncommitted_file_changes = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for FetchFileGitStatusesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse"
    }
}

/// Defines additional types related to [FetchFileGitStatusesResponse].
pub mod fetch_file_git_statuses_response {
    #[allow(unused_imports)]
    use super::*;

    /// Represents the Git state of a file with uncommitted changes.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct UncommittedFileChange {
        /// The file's full path including filename, relative to the workspace root.
        pub path: std::string::String,

        /// Output only. Indicates the status of the file.
        pub state: crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl UncommittedFileChange {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [path][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::path].
        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.path = v.into();
            self
        }

        /// Sets the value of [state][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::state].
        pub fn set_state<
            T: std::convert::Into<
                    crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.state = v.into();
            self
        }
    }

    impl wkt::message::Message for UncommittedFileChange {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange"
        }
    }

    /// Defines additional types related to [UncommittedFileChange].
    pub mod uncommitted_file_change {
        #[allow(unused_imports)]
        use super::*;

        /// Indicates the status of an uncommitted file change.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum State {
            /// Default value. This value is unused.
            Unspecified,
            /// The file has been newly added.
            Added,
            /// The file has been deleted.
            Deleted,
            /// The file has been modified.
            Modified,
            /// The file contains merge conflicts.
            HasConflicts,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [State::value] or
            /// [State::name].
            UnknownValue(state::UnknownValue),
        }

        #[doc(hidden)]
        pub mod state {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl State {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Added => std::option::Option::Some(1),
                    Self::Deleted => std::option::Option::Some(2),
                    Self::Modified => std::option::Option::Some(3),
                    Self::HasConflicts => std::option::Option::Some(4),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                    Self::Added => std::option::Option::Some("ADDED"),
                    Self::Deleted => std::option::Option::Some("DELETED"),
                    Self::Modified => std::option::Option::Some("MODIFIED"),
                    Self::HasConflicts => std::option::Option::Some("HAS_CONFLICTS"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for State {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for State {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for State {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Added,
                    2 => Self::Deleted,
                    3 => Self::Modified,
                    4 => Self::HasConflicts,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for State {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "STATE_UNSPECIFIED" => Self::Unspecified,
                    "ADDED" => Self::Added,
                    "DELETED" => Self::Deleted,
                    "MODIFIED" => Self::Modified,
                    "HAS_CONFLICTS" => Self::HasConflicts,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for State {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Added => serializer.serialize_i32(1),
                    Self::Deleted => serializer.serialize_i32(2),
                    Self::Modified => serializer.serialize_i32(3),
                    Self::HasConflicts => serializer.serialize_i32(4),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for State {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                    ".google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange.State"))
            }
        }
    }
}

/// `FetchGitAheadBehind` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchGitAheadBehindRequest {
    /// Required. The workspace's name.
    pub name: std::string::String,

    /// Optional. The name of the branch in the Git remote against which this
    /// workspace should be compared. If left unset, the repository's default
    /// branch name will be used.
    pub remote_branch: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchGitAheadBehindRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::FetchGitAheadBehindRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [remote_branch][crate::model::FetchGitAheadBehindRequest::remote_branch].
    pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.remote_branch = v.into();
        self
    }
}

impl wkt::message::Message for FetchGitAheadBehindRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindRequest"
    }
}

/// `FetchGitAheadBehind` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchGitAheadBehindResponse {
    /// The number of commits in the remote branch that are not in the workspace.
    pub commits_ahead: i32,

    /// The number of commits in the workspace that are not in the remote branch.
    pub commits_behind: i32,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchGitAheadBehindResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [commits_ahead][crate::model::FetchGitAheadBehindResponse::commits_ahead].
    pub fn set_commits_ahead<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.commits_ahead = v.into();
        self
    }

    /// Sets the value of [commits_behind][crate::model::FetchGitAheadBehindResponse::commits_behind].
    pub fn set_commits_behind<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.commits_behind = v.into();
        self
    }
}

impl wkt::message::Message for FetchGitAheadBehindResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindResponse"
    }
}

/// `CommitWorkspaceChanges` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitWorkspaceChangesRequest {
    /// Required. The workspace's name.
    pub name: std::string::String,

    /// Required. The commit's author.
    pub author: std::option::Option<crate::model::CommitAuthor>,

    /// Optional. The commit's message.
    pub commit_message: std::string::String,

    /// Optional. Full file paths to commit including filename, rooted at workspace
    /// root. If left empty, all files will be committed.
    pub paths: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommitWorkspaceChangesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::CommitWorkspaceChangesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
    pub fn set_author<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
    pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommitAuthor>,
    {
        self.author = v.map(|x| x.into());
        self
    }

    /// Sets the value of [commit_message][crate::model::CommitWorkspaceChangesRequest::commit_message].
    pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.commit_message = v.into();
        self
    }

    /// Sets the value of [paths][crate::model::CommitWorkspaceChangesRequest::paths].
    pub fn set_paths<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.paths = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for CommitWorkspaceChangesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesRequest"
    }
}

/// `CommitWorkspaceChanges` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitWorkspaceChangesResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommitWorkspaceChangesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for CommitWorkspaceChangesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesResponse"
    }
}

/// `ResetWorkspaceChanges` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResetWorkspaceChangesRequest {
    /// Required. The workspace's name.
    pub name: std::string::String,

    /// Optional. Full file paths to reset back to their committed state including
    /// filename, rooted at workspace root. If left empty, all files will be reset.
    pub paths: std::vec::Vec<std::string::String>,

    /// Optional. If set to true, untracked files will be deleted.
    pub clean: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResetWorkspaceChangesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ResetWorkspaceChangesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [paths][crate::model::ResetWorkspaceChangesRequest::paths].
    pub fn set_paths<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.paths = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [clean][crate::model::ResetWorkspaceChangesRequest::clean].
    pub fn set_clean<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.clean = v.into();
        self
    }
}

impl wkt::message::Message for ResetWorkspaceChangesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesRequest"
    }
}

/// `ResetWorkspaceChanges` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResetWorkspaceChangesResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResetWorkspaceChangesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ResetWorkspaceChangesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesResponse"
    }
}

/// `FetchFileDiff` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchFileDiffRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The file's full path including filename, relative to the
    /// workspace root.
    pub path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchFileDiffRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::FetchFileDiffRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::FetchFileDiffRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }
}

impl wkt::message::Message for FetchFileDiffRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffRequest"
    }
}

/// `FetchFileDiff` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchFileDiffResponse {
    /// The raw formatted Git diff for the file.
    pub formatted_diff: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchFileDiffResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [formatted_diff][crate::model::FetchFileDiffResponse::formatted_diff].
    pub fn set_formatted_diff<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.formatted_diff = v.into();
        self
    }
}

impl wkt::message::Message for FetchFileDiffResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffResponse"
    }
}

/// `QueryDirectoryContents` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryDirectoryContentsRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Optional. The directory's full path including directory name, relative to
    /// the workspace root. If left unset, the workspace root is used.
    pub path: std::string::String,

    /// Optional. Maximum number of paths to return. The server may return fewer
    /// items than requested. If unspecified, the server will pick an appropriate
    /// default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `QueryDirectoryContents`
    /// call. Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to
    /// `QueryDirectoryContents`, with the exception of `page_size`, must match the
    /// call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryDirectoryContentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::QueryDirectoryContentsRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::QueryDirectoryContentsRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::QueryDirectoryContentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::QueryDirectoryContentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryDirectoryContentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsRequest"
    }
}

/// `QueryDirectoryContents` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryDirectoryContentsResponse {
    /// List of entries in the directory.
    pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryDirectoryContentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [directory_entries][crate::model::QueryDirectoryContentsResponse::directory_entries].
    pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DirectoryEntry>,
    {
        use std::iter::Iterator;
        self.directory_entries = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::QueryDirectoryContentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryDirectoryContentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for QueryDirectoryContentsResponse {
    type PageItem = crate::model::DirectoryEntry;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.directory_entries
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Represents a single entry in a directory.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DirectoryEntry {
    /// The entry's contents.
    pub entry: std::option::Option<crate::model::directory_entry::Entry>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DirectoryEntry {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [entry][crate::model::DirectoryEntry::entry].
    ///
    /// Note that all the setters affecting `entry` are mutually
    /// exclusive.
    pub fn set_entry<
        T: std::convert::Into<std::option::Option<crate::model::directory_entry::Entry>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.entry = v.into();
        self
    }

    /// The value of [entry][crate::model::DirectoryEntry::entry]
    /// if it holds a `File`, `None` if the field is not set or
    /// holds a different branch.
    pub fn file(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.entry.as_ref().and_then(|v| match v {
            crate::model::directory_entry::Entry::File(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
    /// to hold a `File`.
    ///
    /// Note that all the setters affecting `entry` are
    /// mutually exclusive.
    pub fn set_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entry =
            std::option::Option::Some(crate::model::directory_entry::Entry::File(v.into()));
        self
    }

    /// The value of [entry][crate::model::DirectoryEntry::entry]
    /// if it holds a `Directory`, `None` if the field is not set or
    /// holds a different branch.
    pub fn directory(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.entry.as_ref().and_then(|v| match v {
            crate::model::directory_entry::Entry::Directory(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
    /// to hold a `Directory`.
    ///
    /// Note that all the setters affecting `entry` are
    /// mutually exclusive.
    pub fn set_directory<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entry =
            std::option::Option::Some(crate::model::directory_entry::Entry::Directory(v.into()));
        self
    }
}

impl wkt::message::Message for DirectoryEntry {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DirectoryEntry"
    }
}

/// Defines additional types related to [DirectoryEntry].
pub mod directory_entry {
    #[allow(unused_imports)]
    use super::*;

    /// The entry's contents.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Entry {
        /// A file in the directory.
        File(std::string::String),
        /// A child directory in the directory.
        Directory(std::string::String),
    }
}

/// Configuration containing file search request parameters.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchFilesRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Optional. Maximum number of search results to return. The server may return
    /// fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `SearchFilesRequest`
    /// call. Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `SearchFilesRequest`,
    /// with the exception of `page_size`, must match the call that provided the
    /// page token.
    pub page_token: std::string::String,

    /// Optional. Optional filter for the returned list in filtering format.
    /// Filtering is only currently supported on the `path` field.
    /// See <https://google.aip.dev/160> for details.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchFilesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::SearchFilesRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::SearchFilesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::SearchFilesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::SearchFilesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for SearchFilesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.SearchFilesRequest"
    }
}

/// Client-facing representation of a file search response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchFilesResponse {
    /// List of matched results.
    pub search_results: std::vec::Vec<crate::model::SearchResult>,

    /// Optional. A token, which can be sent as `page_token` to retrieve the next
    /// page. If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchFilesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [search_results][crate::model::SearchFilesResponse::search_results].
    pub fn set_search_results<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SearchResult>,
    {
        use std::iter::Iterator;
        self.search_results = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::SearchFilesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for SearchFilesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.SearchFilesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for SearchFilesResponse {
    type PageItem = crate::model::SearchResult;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.search_results
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Client-facing representation of a search result entry.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchResult {
    /// The entry's contents.
    pub entry: std::option::Option<crate::model::search_result::Entry>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchResult {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [entry][crate::model::SearchResult::entry].
    ///
    /// Note that all the setters affecting `entry` are mutually
    /// exclusive.
    pub fn set_entry<
        T: std::convert::Into<std::option::Option<crate::model::search_result::Entry>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.entry = v.into();
        self
    }

    /// The value of [entry][crate::model::SearchResult::entry]
    /// if it holds a `File`, `None` if the field is not set or
    /// holds a different branch.
    pub fn file(&self) -> std::option::Option<&std::boxed::Box<crate::model::FileSearchResult>> {
        #[allow(unreachable_patterns)]
        self.entry.as_ref().and_then(|v| match v {
            crate::model::search_result::Entry::File(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [entry][crate::model::SearchResult::entry]
    /// to hold a `File`.
    ///
    /// Note that all the setters affecting `entry` are
    /// mutually exclusive.
    pub fn set_file<T: std::convert::Into<std::boxed::Box<crate::model::FileSearchResult>>>(
        mut self,
        v: T,
    ) -> Self {
        self.entry = std::option::Option::Some(crate::model::search_result::Entry::File(v.into()));
        self
    }

    /// The value of [entry][crate::model::SearchResult::entry]
    /// if it holds a `Directory`, `None` if the field is not set or
    /// holds a different branch.
    pub fn directory(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::DirectorySearchResult>> {
        #[allow(unreachable_patterns)]
        self.entry.as_ref().and_then(|v| match v {
            crate::model::search_result::Entry::Directory(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [entry][crate::model::SearchResult::entry]
    /// to hold a `Directory`.
    ///
    /// Note that all the setters affecting `entry` are
    /// mutually exclusive.
    pub fn set_directory<
        T: std::convert::Into<std::boxed::Box<crate::model::DirectorySearchResult>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.entry =
            std::option::Option::Some(crate::model::search_result::Entry::Directory(v.into()));
        self
    }
}

impl wkt::message::Message for SearchResult {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.SearchResult"
    }
}

/// Defines additional types related to [SearchResult].
pub mod search_result {
    #[allow(unused_imports)]
    use super::*;

    /// The entry's contents.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Entry {
        /// Details when search result is a file.
        File(std::boxed::Box<crate::model::FileSearchResult>),
        /// Details when search result is a directory.
        Directory(std::boxed::Box<crate::model::DirectorySearchResult>),
    }
}

/// Client-facing representation of a file entry in search results.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FileSearchResult {
    /// File system path relative to the workspace root.
    pub path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FileSearchResult {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [path][crate::model::FileSearchResult::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }
}

impl wkt::message::Message for FileSearchResult {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.FileSearchResult"
    }
}

/// Client-facing representation of a directory entry in search results.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DirectorySearchResult {
    /// File system path relative to the workspace root.
    pub path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DirectorySearchResult {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [path][crate::model::DirectorySearchResult::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }
}

impl wkt::message::Message for DirectorySearchResult {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DirectorySearchResult"
    }
}

/// `MakeDirectory` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MakeDirectoryRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The directory's full path including directory name, relative to
    /// the workspace root.
    pub path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MakeDirectoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::MakeDirectoryRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::MakeDirectoryRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }
}

impl wkt::message::Message for MakeDirectoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryRequest"
    }
}

/// `MakeDirectory` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MakeDirectoryResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MakeDirectoryResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for MakeDirectoryResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryResponse"
    }
}

/// `RemoveDirectory` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveDirectoryRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The directory's full path including directory name, relative to
    /// the workspace root.
    pub path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RemoveDirectoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::RemoveDirectoryRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::RemoveDirectoryRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }
}

impl wkt::message::Message for RemoveDirectoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryRequest"
    }
}

/// `RemoveDirectory` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveDirectoryResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RemoveDirectoryResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for RemoveDirectoryResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryResponse"
    }
}

/// `MoveDirectory` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveDirectoryRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The directory's full path including directory name, relative to
    /// the workspace root.
    pub path: std::string::String,

    /// Required. The new path for the directory including directory name, rooted
    /// at workspace root.
    pub new_path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MoveDirectoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::MoveDirectoryRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::MoveDirectoryRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [new_path][crate::model::MoveDirectoryRequest::new_path].
    pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.new_path = v.into();
        self
    }
}

impl wkt::message::Message for MoveDirectoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryRequest"
    }
}

/// `MoveDirectory` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveDirectoryResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MoveDirectoryResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for MoveDirectoryResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryResponse"
    }
}

/// `ReadFile` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReadFileRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The file's full path including filename, relative to the
    /// workspace root.
    pub path: std::string::String,

    /// Optional. The Git revision of the file to return. If left empty, the
    /// current contents of `path` will be returned.
    pub revision: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ReadFileRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::ReadFileRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::ReadFileRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [revision][crate::model::ReadFileRequest::revision].
    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.revision = v.into();
        self
    }
}

impl wkt::message::Message for ReadFileRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ReadFileRequest"
    }
}

/// `ReadFile` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReadFileResponse {
    /// The file's contents.
    pub file_contents: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ReadFileResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [file_contents][crate::model::ReadFileResponse::file_contents].
    pub fn set_file_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.file_contents = v.into();
        self
    }
}

impl wkt::message::Message for ReadFileResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ReadFileResponse"
    }
}

/// `RemoveFile` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveFileRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The file's full path including filename, relative to the
    /// workspace root.
    pub path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RemoveFileRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::RemoveFileRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::RemoveFileRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }
}

impl wkt::message::Message for RemoveFileRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.RemoveFileRequest"
    }
}

/// `RemoveFile` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveFileResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RemoveFileResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for RemoveFileResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.RemoveFileResponse"
    }
}

/// `MoveFile` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveFileRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The file's full path including filename, relative to the
    /// workspace root.
    pub path: std::string::String,

    /// Required. The file's new path including filename, relative to the workspace
    /// root.
    pub new_path: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MoveFileRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::MoveFileRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::MoveFileRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [new_path][crate::model::MoveFileRequest::new_path].
    pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.new_path = v.into();
        self
    }
}

impl wkt::message::Message for MoveFileRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.MoveFileRequest"
    }
}

/// `MoveFile` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveFileResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MoveFileResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for MoveFileResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.MoveFileResponse"
    }
}

/// `WriteFile` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WriteFileRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    /// Required. The file.
    pub path: std::string::String,

    /// Required. The file's contents.
    pub contents: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WriteFileRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::WriteFileRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }

    /// Sets the value of [path][crate::model::WriteFileRequest::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [contents][crate::model::WriteFileRequest::contents].
    pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.contents = v.into();
        self
    }
}

impl wkt::message::Message for WriteFileRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.WriteFileRequest"
    }
}

/// `WriteFile` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WriteFileResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WriteFileResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for WriteFileResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.WriteFileResponse"
    }
}

/// `InstallNpmPackages` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstallNpmPackagesRequest {
    /// Required. The workspace's name.
    pub workspace: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InstallNpmPackagesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workspace][crate::model::InstallNpmPackagesRequest::workspace].
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workspace = v.into();
        self
    }
}

impl wkt::message::Message for InstallNpmPackagesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesRequest"
    }
}

/// `InstallNpmPackages` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstallNpmPackagesResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InstallNpmPackagesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for InstallNpmPackagesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesResponse"
    }
}

/// Represents a Dataform release configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReleaseConfig {
    /// Identifier. The release config's name.
    pub name: std::string::String,

    /// Required. Git commit/tag/branch name at which the repository should be
    /// compiled. Must exist in the remote repository. Examples:
    ///
    /// - a commit SHA: `12ade345`
    /// - a tag: `tag1`
    /// - a branch name: `branch1`
    pub git_commitish: std::string::String,

    /// Optional. If set, fields of `code_compilation_config` override the default
    /// compilation settings that are specified in dataform.json.
    pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,

    /// Optional. Optional schedule (in cron format) for automatic creation of
    /// compilation results.
    pub cron_schedule: std::string::String,

    /// Optional. Specifies the time zone to be used when interpreting
    /// cron_schedule. Must be a time zone name from the time zone database
    /// (<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>). If left
    /// unspecified, the default is UTC.
    pub time_zone: std::string::String,

    /// Output only. Records of the 10 most recent scheduled release attempts,
    /// ordered in descending order of `release_time`. Updated whenever automatic
    /// creation of a compilation result is triggered by cron_schedule.
    pub recent_scheduled_release_records:
        std::vec::Vec<crate::model::release_config::ScheduledReleaseRecord>,

    /// Optional. The name of the currently released compilation result for this
    /// release config. This value is updated when a compilation result is
    /// automatically created from this release config (using cron_schedule), or
    /// when this resource is updated by API call (perhaps to roll back to an
    /// earlier release). The compilation result must have been created using this
    /// release config. Must be in the format
    /// `projects/*/locations/*/repositories/*/compilationResults/*`.
    pub release_compilation_result: std::string::String,

    /// Optional. Disables automatic creation of compilation results.
    pub disabled: bool,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ReleaseConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ReleaseConfig::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [git_commitish][crate::model::ReleaseConfig::git_commitish].
    pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.git_commitish = v.into();
        self
    }

    /// Sets the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
    pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CodeCompilationConfig>,
    {
        self.code_compilation_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
    pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CodeCompilationConfig>,
    {
        self.code_compilation_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [cron_schedule][crate::model::ReleaseConfig::cron_schedule].
    pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.cron_schedule = v.into();
        self
    }

    /// Sets the value of [time_zone][crate::model::ReleaseConfig::time_zone].
    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.time_zone = v.into();
        self
    }

    /// Sets the value of [recent_scheduled_release_records][crate::model::ReleaseConfig::recent_scheduled_release_records].
    pub fn set_recent_scheduled_release_records<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::release_config::ScheduledReleaseRecord>,
    {
        use std::iter::Iterator;
        self.recent_scheduled_release_records = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [release_compilation_result][crate::model::ReleaseConfig::release_compilation_result].
    pub fn set_release_compilation_result<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.release_compilation_result = v.into();
        self
    }

    /// Sets the value of [disabled][crate::model::ReleaseConfig::disabled].
    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.disabled = v.into();
        self
    }

    /// Sets the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ReleaseConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig"
    }
}

/// Defines additional types related to [ReleaseConfig].
pub mod release_config {
    #[allow(unused_imports)]
    use super::*;

    /// A record of an attempt to create a compilation result for this release
    /// config.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ScheduledReleaseRecord {
        /// Output only. The timestamp of this release attempt.
        pub release_time: std::option::Option<wkt::Timestamp>,

        /// The result of this release attempt.
        pub result:
            std::option::Option<crate::model::release_config::scheduled_release_record::Result>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ScheduledReleaseRecord {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
        pub fn set_release_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.release_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
        pub fn set_or_clear_release_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.release_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result].
        ///
        /// Note that all the setters affecting `result` are mutually
        /// exclusive.
        pub fn set_result<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::release_config::scheduled_release_record::Result,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.result = v.into();
            self
        }

        /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
        /// if it holds a `CompilationResult`, `None` if the field is not set or
        /// holds a different branch.
        pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
            #[allow(unreachable_patterns)]
            self.result.as_ref().and_then(|v| match v {
                crate::model::release_config::scheduled_release_record::Result::CompilationResult(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
        /// to hold a `CompilationResult`.
        ///
        /// Note that all the setters affecting `result` are
        /// mutually exclusive.
        pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.result = std::option::Option::Some(
                crate::model::release_config::scheduled_release_record::Result::CompilationResult(
                    v.into(),
                ),
            );
            self
        }

        /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
        /// if it holds a `ErrorStatus`, `None` if the field is not set or
        /// holds a different branch.
        pub fn error_status(&self) -> std::option::Option<&std::boxed::Box<rpc::model::Status>> {
            #[allow(unreachable_patterns)]
            self.result.as_ref().and_then(|v| match v {
                crate::model::release_config::scheduled_release_record::Result::ErrorStatus(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
        /// to hold a `ErrorStatus`.
        ///
        /// Note that all the setters affecting `result` are
        /// mutually exclusive.
        pub fn set_error_status<T: std::convert::Into<std::boxed::Box<rpc::model::Status>>>(
            mut self,
            v: T,
        ) -> Self {
            self.result = std::option::Option::Some(
                crate::model::release_config::scheduled_release_record::Result::ErrorStatus(
                    v.into(),
                ),
            );
            self
        }
    }

    impl wkt::message::Message for ScheduledReleaseRecord {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig.ScheduledReleaseRecord"
        }
    }

    /// Defines additional types related to [ScheduledReleaseRecord].
    pub mod scheduled_release_record {
        #[allow(unused_imports)]
        use super::*;

        /// The result of this release attempt.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Result {
            /// The name of the created compilation result, if one was successfully
            /// created. Must be in the format
            /// `projects/*/locations/*/repositories/*/compilationResults/*`.
            CompilationResult(std::string::String),
            /// The error status encountered upon this attempt to create the
            /// compilation result, if the attempt was unsuccessful.
            ErrorStatus(std::boxed::Box<rpc::model::Status>),
        }
    }
}

/// `ListReleaseConfigs` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReleaseConfigsRequest {
    /// Required. The repository in which to list release configs. Must be in the
    /// format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Optional. Maximum number of release configs to return. The server may
    /// return fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `ListReleaseConfigs` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListReleaseConfigs`,
    /// with the exception of `page_size`, must match the call that provided the
    /// page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListReleaseConfigsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListReleaseConfigsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListReleaseConfigsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListReleaseConfigsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListReleaseConfigsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsRequest"
    }
}

/// `ListReleaseConfigs` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReleaseConfigsResponse {
    /// List of release configs.
    pub release_configs: std::vec::Vec<crate::model::ReleaseConfig>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations which could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListReleaseConfigsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [release_configs][crate::model::ListReleaseConfigsResponse::release_configs].
    pub fn set_release_configs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ReleaseConfig>,
    {
        use std::iter::Iterator;
        self.release_configs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListReleaseConfigsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListReleaseConfigsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListReleaseConfigsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListReleaseConfigsResponse {
    type PageItem = crate::model::ReleaseConfig;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.release_configs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// `GetReleaseConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetReleaseConfigRequest {
    /// Required. The release config's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetReleaseConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetReleaseConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetReleaseConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.GetReleaseConfigRequest"
    }
}

/// `CreateReleaseConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateReleaseConfigRequest {
    /// Required. The repository in which to create the release config. Must be in
    /// the format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Required. The release config to create.
    pub release_config: std::option::Option<crate::model::ReleaseConfig>,

    /// Required. The ID to use for the release config, which will become the final
    /// component of the release config's resource name.
    pub release_config_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateReleaseConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateReleaseConfigRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
    pub fn set_release_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ReleaseConfig>,
    {
        self.release_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
    pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ReleaseConfig>,
    {
        self.release_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [release_config_id][crate::model::CreateReleaseConfigRequest::release_config_id].
    pub fn set_release_config_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.release_config_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateReleaseConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CreateReleaseConfigRequest"
    }
}

/// `UpdateReleaseConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateReleaseConfigRequest {
    /// Optional. Specifies the fields to be updated in the release config. If left
    /// unset, all fields will be updated.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The release config to update.
    pub release_config: std::option::Option<crate::model::ReleaseConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateReleaseConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
    pub fn set_release_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ReleaseConfig>,
    {
        self.release_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
    pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ReleaseConfig>,
    {
        self.release_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateReleaseConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.UpdateReleaseConfigRequest"
    }
}

/// `DeleteReleaseConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteReleaseConfigRequest {
    /// Required. The release config's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteReleaseConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteReleaseConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteReleaseConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DeleteReleaseConfigRequest"
    }
}

/// Represents the result of compiling a Dataform project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CompilationResult {
    /// Output only. The compilation result's name.
    pub name: std::string::String,

    /// Immutable. If set, fields of `code_compilation_config` override the default
    /// compilation settings that are specified in dataform.json.
    pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,

    /// Output only. The fully resolved Git commit SHA of the code that was
    /// compiled. Not set for compilation results whose source is a workspace.
    pub resolved_git_commit_sha: std::string::String,

    /// Output only. The version of `@dataform/core` that was used for compilation.
    pub dataform_core_version: std::string::String,

    /// Output only. Errors encountered during project compilation.
    pub compilation_errors: std::vec::Vec<crate::model::compilation_result::CompilationError>,

    /// Output only. Only set if the repository has a KMS Key.
    pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,

    /// Output only. The timestamp of when the compilation result was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    /// The source of the compilation result.
    pub source: std::option::Option<crate::model::compilation_result::Source>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CompilationResult {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::CompilationResult::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
    pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CodeCompilationConfig>,
    {
        self.code_compilation_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
    pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CodeCompilationConfig>,
    {
        self.code_compilation_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resolved_git_commit_sha][crate::model::CompilationResult::resolved_git_commit_sha].
    pub fn set_resolved_git_commit_sha<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.resolved_git_commit_sha = v.into();
        self
    }

    /// Sets the value of [dataform_core_version][crate::model::CompilationResult::dataform_core_version].
    pub fn set_dataform_core_version<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.dataform_core_version = v.into();
        self
    }

    /// Sets the value of [compilation_errors][crate::model::CompilationResult::compilation_errors].
    pub fn set_compilation_errors<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::compilation_result::CompilationError>,
    {
        use std::iter::Iterator;
        self.compilation_errors = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
    pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
    pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::CompilationResult::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::CompilationResult::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source][crate::model::CompilationResult::source].
    ///
    /// Note that all the setters affecting `source` are mutually
    /// exclusive.
    pub fn set_source<
        T: std::convert::Into<std::option::Option<crate::model::compilation_result::Source>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.source = v.into();
        self
    }

    /// The value of [source][crate::model::CompilationResult::source]
    /// if it holds a `GitCommitish`, `None` if the field is not set or
    /// holds a different branch.
    pub fn git_commitish(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.source.as_ref().and_then(|v| match v {
            crate::model::compilation_result::Source::GitCommitish(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [source][crate::model::CompilationResult::source]
    /// to hold a `GitCommitish`.
    ///
    /// Note that all the setters affecting `source` are
    /// mutually exclusive.
    pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source = std::option::Option::Some(
            crate::model::compilation_result::Source::GitCommitish(v.into()),
        );
        self
    }

    /// The value of [source][crate::model::CompilationResult::source]
    /// if it holds a `Workspace`, `None` if the field is not set or
    /// holds a different branch.
    pub fn workspace(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.source.as_ref().and_then(|v| match v {
            crate::model::compilation_result::Source::Workspace(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [source][crate::model::CompilationResult::source]
    /// to hold a `Workspace`.
    ///
    /// Note that all the setters affecting `source` are
    /// mutually exclusive.
    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source = std::option::Option::Some(
            crate::model::compilation_result::Source::Workspace(v.into()),
        );
        self
    }

    /// The value of [source][crate::model::CompilationResult::source]
    /// if it holds a `ReleaseConfig`, `None` if the field is not set or
    /// holds a different branch.
    pub fn release_config(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.source.as_ref().and_then(|v| match v {
            crate::model::compilation_result::Source::ReleaseConfig(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [source][crate::model::CompilationResult::source]
    /// to hold a `ReleaseConfig`.
    ///
    /// Note that all the setters affecting `source` are
    /// mutually exclusive.
    pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source = std::option::Option::Some(
            crate::model::compilation_result::Source::ReleaseConfig(v.into()),
        );
        self
    }
}

impl wkt::message::Message for CompilationResult {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CompilationResult"
    }
}

/// Defines additional types related to [CompilationResult].
pub mod compilation_result {
    #[allow(unused_imports)]
    use super::*;

    /// An error encountered when attempting to compile a Dataform project.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct CompilationError {
        /// Output only. The error's top level message.
        pub message: std::string::String,

        /// Output only. The error's full stack trace.
        pub stack: std::string::String,

        /// Output only. The path of the file where this error occurred, if
        /// available, relative to the project root.
        pub path: std::string::String,

        /// Output only. The identifier of the action where this error occurred, if
        /// available.
        pub action_target: std::option::Option<crate::model::Target>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl CompilationError {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [message][crate::model::compilation_result::CompilationError::message].
        pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.message = v.into();
            self
        }

        /// Sets the value of [stack][crate::model::compilation_result::CompilationError::stack].
        pub fn set_stack<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.stack = v.into();
            self
        }

        /// Sets the value of [path][crate::model::compilation_result::CompilationError::path].
        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.path = v.into();
            self
        }

        /// Sets the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
        pub fn set_action_target<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Target>,
        {
            self.action_target = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
        pub fn set_or_clear_action_target<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Target>,
        {
            self.action_target = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for CompilationError {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResult.CompilationError"
        }
    }

    /// The source of the compilation result.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Source {
        /// Immutable. Git commit/tag/branch name at which the repository should be
        /// compiled. Must exist in the remote repository. Examples:
        ///
        /// - a commit SHA: `12ade345`
        /// - a tag: `tag1`
        /// - a branch name: `branch1`
        GitCommitish(std::string::String),
        /// Immutable. The name of the workspace to compile. Must be in the format
        /// `projects/*/locations/*/repositories/*/workspaces/*`.
        Workspace(std::string::String),
        /// Immutable. The name of the release config to compile. Must be in the
        /// format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
        ReleaseConfig(std::string::String),
    }
}

/// Configures various aspects of Dataform code compilation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CodeCompilationConfig {
    /// Optional. The default database (Google Cloud project ID).
    pub default_database: std::string::String,

    /// Optional. The default schema (BigQuery dataset ID).
    pub default_schema: std::string::String,

    /// Optional. The default BigQuery location to use. Defaults to "US".
    /// See the BigQuery docs for a full list of locations:
    /// <https://cloud.google.com/bigquery/docs/locations>.
    pub default_location: std::string::String,

    /// Optional. The default schema (BigQuery dataset ID) for assertions.
    pub assertion_schema: std::string::String,

    /// Optional. User-defined variables that are made available to project code
    /// during compilation.
    pub vars: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. The suffix that should be appended to all database (Google Cloud
    /// project ID) names.
    pub database_suffix: std::string::String,

    /// Optional. The suffix that should be appended to all schema (BigQuery
    /// dataset ID) names.
    pub schema_suffix: std::string::String,

    /// Optional. The prefix that should be prepended to all table names.
    pub table_prefix: std::string::String,

    /// Optional. The prefix to prepend to built-in assertion names.
    pub builtin_assertion_name_prefix: std::string::String,

    /// Optional. The default notebook runtime options.
    pub default_notebook_runtime_options: std::option::Option<crate::model::NotebookRuntimeOptions>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CodeCompilationConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [default_database][crate::model::CodeCompilationConfig::default_database].
    pub fn set_default_database<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.default_database = v.into();
        self
    }

    /// Sets the value of [default_schema][crate::model::CodeCompilationConfig::default_schema].
    pub fn set_default_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.default_schema = v.into();
        self
    }

    /// Sets the value of [default_location][crate::model::CodeCompilationConfig::default_location].
    pub fn set_default_location<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.default_location = v.into();
        self
    }

    /// Sets the value of [assertion_schema][crate::model::CodeCompilationConfig::assertion_schema].
    pub fn set_assertion_schema<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.assertion_schema = v.into();
        self
    }

    /// Sets the value of [vars][crate::model::CodeCompilationConfig::vars].
    pub fn set_vars<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.vars = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [database_suffix][crate::model::CodeCompilationConfig::database_suffix].
    pub fn set_database_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.database_suffix = v.into();
        self
    }

    /// Sets the value of [schema_suffix][crate::model::CodeCompilationConfig::schema_suffix].
    pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.schema_suffix = v.into();
        self
    }

    /// Sets the value of [table_prefix][crate::model::CodeCompilationConfig::table_prefix].
    pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.table_prefix = v.into();
        self
    }

    /// Sets the value of [builtin_assertion_name_prefix][crate::model::CodeCompilationConfig::builtin_assertion_name_prefix].
    pub fn set_builtin_assertion_name_prefix<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.builtin_assertion_name_prefix = v.into();
        self
    }

    /// Sets the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
    pub fn set_default_notebook_runtime_options<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
    {
        self.default_notebook_runtime_options = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
    pub fn set_or_clear_default_notebook_runtime_options<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
    {
        self.default_notebook_runtime_options = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CodeCompilationConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CodeCompilationConfig"
    }
}

/// Configures various aspects of Dataform notebook runtime.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NotebookRuntimeOptions {
    /// Optional. The resource name of the [Colab runtime template]
    /// (<https://cloud.google.com/colab/docs/runtimes>), from which a runtime is
    /// created for notebook executions. If not specified, a runtime is created
    /// with Colab's default specifications.
    pub ai_platform_notebook_runtime_template: std::string::String,

    /// The location to store the notebook execution result.
    pub execution_sink: std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NotebookRuntimeOptions {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [ai_platform_notebook_runtime_template][crate::model::NotebookRuntimeOptions::ai_platform_notebook_runtime_template].
    pub fn set_ai_platform_notebook_runtime_template<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.ai_platform_notebook_runtime_template = v.into();
        self
    }

    /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink].
    ///
    /// Note that all the setters affecting `execution_sink` are mutually
    /// exclusive.
    pub fn set_execution_sink<
        T: std::convert::Into<
                std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.execution_sink = v.into();
        self
    }

    /// The value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
    /// if it holds a `GcsOutputBucket`, `None` if the field is not set or
    /// holds a different branch.
    pub fn gcs_output_bucket(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.execution_sink.as_ref().and_then(|v| match v {
            crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
    /// to hold a `GcsOutputBucket`.
    ///
    /// Note that all the setters affecting `execution_sink` are
    /// mutually exclusive.
    pub fn set_gcs_output_bucket<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.execution_sink = std::option::Option::Some(
            crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v.into()),
        );
        self
    }
}

impl wkt::message::Message for NotebookRuntimeOptions {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.NotebookRuntimeOptions"
    }
}

/// Defines additional types related to [NotebookRuntimeOptions].
pub mod notebook_runtime_options {
    #[allow(unused_imports)]
    use super::*;

    /// The location to store the notebook execution result.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ExecutionSink {
        /// Optional. The Google Cloud Storage location to upload the result to.
        /// Format: `gs://bucket-name`.
        GcsOutputBucket(std::string::String),
    }
}

/// `ListCompilationResults` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCompilationResultsRequest {
    /// Required. The repository in which to list compilation results. Must be in
    /// the format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Optional. Maximum number of compilation results to return. The server may
    /// return fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `ListCompilationResults`
    /// call. Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListCompilationResults`,
    /// with the exception of `page_size`, must match the call that provided the
    /// page token.
    pub page_token: std::string::String,

    /// Optional. This field only supports ordering by `name` and `create_time`.
    /// If unspecified, the server will choose the ordering.
    /// If specified, the default order is ascending for the `name` field.
    pub order_by: std::string::String,

    /// Optional. Filter for the returned list.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCompilationResultsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListCompilationResultsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListCompilationResultsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListCompilationResultsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListCompilationResultsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListCompilationResultsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListCompilationResultsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsRequest"
    }
}

/// `ListCompilationResults` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCompilationResultsResponse {
    /// List of compilation results.
    pub compilation_results: std::vec::Vec<crate::model::CompilationResult>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations which could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCompilationResultsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [compilation_results][crate::model::ListCompilationResultsResponse::compilation_results].
    pub fn set_compilation_results<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::CompilationResult>,
    {
        use std::iter::Iterator;
        self.compilation_results = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListCompilationResultsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListCompilationResultsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListCompilationResultsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListCompilationResultsResponse {
    type PageItem = crate::model::CompilationResult;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.compilation_results
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// `GetCompilationResult` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCompilationResultRequest {
    /// Required. The compilation result's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetCompilationResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetCompilationResultRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetCompilationResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.GetCompilationResultRequest"
    }
}

/// `CreateCompilationResult` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCompilationResultRequest {
    /// Required. The repository in which to create the compilation result. Must be
    /// in the format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Required. The compilation result to create.
    pub compilation_result: std::option::Option<crate::model::CompilationResult>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateCompilationResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateCompilationResultRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
    pub fn set_compilation_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CompilationResult>,
    {
        self.compilation_result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
    pub fn set_or_clear_compilation_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CompilationResult>,
    {
        self.compilation_result = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateCompilationResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CreateCompilationResultRequest"
    }
}

/// Represents an action identifier. If the action writes output, the output
/// will be written to the referenced database object.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Target {
    /// Optional. The action's database (Google Cloud project ID) .
    pub database: std::string::String,

    /// Optional. The action's schema (BigQuery dataset ID), within `database`.
    pub schema: std::string::String,

    /// Optional. The action's name, within `database` and `schema`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Target {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [database][crate::model::Target::database].
    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.database = v.into();
        self
    }

    /// Sets the value of [schema][crate::model::Target::schema].
    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.schema = v.into();
        self
    }

    /// Sets the value of [name][crate::model::Target::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for Target {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.Target"
    }
}

/// Describes a relation and its columns.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RelationDescriptor {
    /// A text description of the relation.
    pub description: std::string::String,

    /// A list of descriptions of columns within the relation.
    pub columns: std::vec::Vec<crate::model::relation_descriptor::ColumnDescriptor>,

    /// A set of BigQuery labels that should be applied to the relation.
    pub bigquery_labels: std::collections::HashMap<std::string::String, std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RelationDescriptor {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [description][crate::model::RelationDescriptor::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [columns][crate::model::RelationDescriptor::columns].
    pub fn set_columns<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::relation_descriptor::ColumnDescriptor>,
    {
        use std::iter::Iterator;
        self.columns = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [bigquery_labels][crate::model::RelationDescriptor::bigquery_labels].
    pub fn set_bigquery_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.bigquery_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for RelationDescriptor {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor"
    }
}

/// Defines additional types related to [RelationDescriptor].
pub mod relation_descriptor {
    #[allow(unused_imports)]
    use super::*;

    /// Describes a column.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ColumnDescriptor {
        /// The identifier for the column. Each entry in `path` represents one level
        /// of nesting.
        pub path: std::vec::Vec<std::string::String>,

        /// A textual description of the column.
        pub description: std::string::String,

        /// A list of BigQuery policy tags that will be applied to the column.
        pub bigquery_policy_tags: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ColumnDescriptor {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [path][crate::model::relation_descriptor::ColumnDescriptor::path].
        pub fn set_path<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.path = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [description][crate::model::relation_descriptor::ColumnDescriptor::description].
        pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.description = v.into();
            self
        }

        /// Sets the value of [bigquery_policy_tags][crate::model::relation_descriptor::ColumnDescriptor::bigquery_policy_tags].
        pub fn set_bigquery_policy_tags<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.bigquery_policy_tags = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for ColumnDescriptor {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor.ColumnDescriptor"
        }
    }
}

/// Represents a single Dataform action in a compilation result.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CompilationResultAction {
    /// This action's identifier. Unique within the compilation result.
    pub target: std::option::Option<crate::model::Target>,

    /// The action's identifier if the project had been compiled without any
    /// overrides configured. Unique within the compilation result.
    pub canonical_target: std::option::Option<crate::model::Target>,

    /// The full path including filename in which this action is located, relative
    /// to the workspace root.
    pub file_path: std::string::String,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    /// The compiled object.
    pub compiled_object:
        std::option::Option<crate::model::compilation_result_action::CompiledObject>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CompilationResultAction {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [target][crate::model::CompilationResultAction::target].
    pub fn set_target<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.target = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [target][crate::model::CompilationResultAction::target].
    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.target = v.map(|x| x.into());
        self
    }

    /// Sets the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
    pub fn set_canonical_target<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.canonical_target = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
    pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.canonical_target = v.map(|x| x.into());
        self
    }

    /// Sets the value of [file_path][crate::model::CompilationResultAction::file_path].
    pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.file_path = v.into();
        self
    }

    /// Sets the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object].
    ///
    /// Note that all the setters affecting `compiled_object` are mutually
    /// exclusive.
    pub fn set_compiled_object<
        T: std::convert::Into<
                std::option::Option<crate::model::compilation_result_action::CompiledObject>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compiled_object = v.into();
        self
    }

    /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// if it holds a `Relation`, `None` if the field is not set or
    /// holds a different branch.
    pub fn relation(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Relation>>
    {
        #[allow(unreachable_patterns)]
        self.compiled_object.as_ref().and_then(|v| match v {
            crate::model::compilation_result_action::CompiledObject::Relation(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// to hold a `Relation`.
    ///
    /// Note that all the setters affecting `compiled_object` are
    /// mutually exclusive.
    pub fn set_relation<
        T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Relation>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compiled_object = std::option::Option::Some(
            crate::model::compilation_result_action::CompiledObject::Relation(v.into()),
        );
        self
    }

    /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// if it holds a `Operations`, `None` if the field is not set or
    /// holds a different branch.
    pub fn operations(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Operations>>
    {
        #[allow(unreachable_patterns)]
        self.compiled_object.as_ref().and_then(|v| match v {
            crate::model::compilation_result_action::CompiledObject::Operations(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// to hold a `Operations`.
    ///
    /// Note that all the setters affecting `compiled_object` are
    /// mutually exclusive.
    pub fn set_operations<
        T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Operations>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compiled_object = std::option::Option::Some(
            crate::model::compilation_result_action::CompiledObject::Operations(v.into()),
        );
        self
    }

    /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// if it holds a `Assertion`, `None` if the field is not set or
    /// holds a different branch.
    pub fn assertion(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Assertion>>
    {
        #[allow(unreachable_patterns)]
        self.compiled_object.as_ref().and_then(|v| match v {
            crate::model::compilation_result_action::CompiledObject::Assertion(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// to hold a `Assertion`.
    ///
    /// Note that all the setters affecting `compiled_object` are
    /// mutually exclusive.
    pub fn set_assertion<
        T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Assertion>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compiled_object = std::option::Option::Some(
            crate::model::compilation_result_action::CompiledObject::Assertion(v.into()),
        );
        self
    }

    /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// if it holds a `Declaration`, `None` if the field is not set or
    /// holds a different branch.
    pub fn declaration(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Declaration>>
    {
        #[allow(unreachable_patterns)]
        self.compiled_object.as_ref().and_then(|v| match v {
            crate::model::compilation_result_action::CompiledObject::Declaration(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// to hold a `Declaration`.
    ///
    /// Note that all the setters affecting `compiled_object` are
    /// mutually exclusive.
    pub fn set_declaration<
        T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Declaration>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compiled_object = std::option::Option::Some(
            crate::model::compilation_result_action::CompiledObject::Declaration(v.into()),
        );
        self
    }

    /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// if it holds a `Notebook`, `None` if the field is not set or
    /// holds a different branch.
    pub fn notebook(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Notebook>>
    {
        #[allow(unreachable_patterns)]
        self.compiled_object.as_ref().and_then(|v| match v {
            crate::model::compilation_result_action::CompiledObject::Notebook(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// to hold a `Notebook`.
    ///
    /// Note that all the setters affecting `compiled_object` are
    /// mutually exclusive.
    pub fn set_notebook<
        T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Notebook>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compiled_object = std::option::Option::Some(
            crate::model::compilation_result_action::CompiledObject::Notebook(v.into()),
        );
        self
    }

    /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// if it holds a `DataPreparation`, `None` if the field is not set or
    /// holds a different branch.
    pub fn data_preparation(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
    > {
        #[allow(unreachable_patterns)]
        self.compiled_object.as_ref().and_then(|v| match v {
            crate::model::compilation_result_action::CompiledObject::DataPreparation(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
    /// to hold a `DataPreparation`.
    ///
    /// Note that all the setters affecting `compiled_object` are
    /// mutually exclusive.
    pub fn set_data_preparation<
        T: std::convert::Into<
                std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compiled_object = std::option::Option::Some(
            crate::model::compilation_result_action::CompiledObject::DataPreparation(v.into()),
        );
        self
    }
}

impl wkt::message::Message for CompilationResultAction {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction"
    }
}

/// Defines additional types related to [CompilationResultAction].
pub mod compilation_result_action {
    #[allow(unused_imports)]
    use super::*;

    /// Represents a database relation.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Relation {
        /// A list of actions that this action depends on.
        pub dependency_targets: std::vec::Vec<crate::model::Target>,

        /// Whether this action is disabled (i.e. should not be run).
        pub disabled: bool,

        /// Arbitrary, user-defined tags on this action.
        pub tags: std::vec::Vec<std::string::String>,

        /// Descriptor for the relation and its columns.
        pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,

        /// The type of this relation.
        pub relation_type: crate::model::compilation_result_action::relation::RelationType,

        /// The SELECT query which returns rows which this relation should contain.
        pub select_query: std::string::String,

        /// SQL statements to be executed before creating the relation.
        pub pre_operations: std::vec::Vec<std::string::String>,

        /// SQL statements to be executed after creating the relation.
        pub post_operations: std::vec::Vec<std::string::String>,

        /// Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
        /// `relation_type` is `INCREMENTAL_TABLE`.
        pub incremental_table_config: std::option::Option<
            crate::model::compilation_result_action::relation::IncrementalTableConfig,
        >,

        /// The SQL expression used to partition the relation.
        pub partition_expression: std::string::String,

        /// A list of columns or SQL expressions used to cluster the table.
        pub cluster_expressions: std::vec::Vec<std::string::String>,

        /// Sets the partition expiration in days.
        pub partition_expiration_days: i32,

        /// Specifies whether queries on this table must include a predicate filter
        /// that filters on the partitioning column.
        pub require_partition_filter: bool,

        /// Additional options that will be provided as key/value pairs into the
        /// options clause of a create table/view statement. See
        /// <https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language>
        /// for more information on which options are supported.
        pub additional_options: std::collections::HashMap<std::string::String, std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Relation {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Relation::dependency_targets].
        pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Target>,
        {
            use std::iter::Iterator;
            self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [disabled][crate::model::compilation_result_action::Relation::disabled].
        pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.disabled = v.into();
            self
        }

        /// Sets the value of [tags][crate::model::compilation_result_action::Relation::tags].
        pub fn set_tags<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.tags = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
        pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
        pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = v.map(|x| x.into());
            self
        }

        /// Sets the value of [relation_type][crate::model::compilation_result_action::Relation::relation_type].
        pub fn set_relation_type<
            T: std::convert::Into<crate::model::compilation_result_action::relation::RelationType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.relation_type = v.into();
            self
        }

        /// Sets the value of [select_query][crate::model::compilation_result_action::Relation::select_query].
        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.select_query = v.into();
            self
        }

        /// Sets the value of [pre_operations][crate::model::compilation_result_action::Relation::pre_operations].
        pub fn set_pre_operations<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.pre_operations = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [post_operations][crate::model::compilation_result_action::Relation::post_operations].
        pub fn set_post_operations<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.post_operations = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
        pub fn set_incremental_table_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<
                    crate::model::compilation_result_action::relation::IncrementalTableConfig,
                >,
        {
            self.incremental_table_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
        pub fn set_or_clear_incremental_table_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<
                    crate::model::compilation_result_action::relation::IncrementalTableConfig,
                >,
        {
            self.incremental_table_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [partition_expression][crate::model::compilation_result_action::Relation::partition_expression].
        pub fn set_partition_expression<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.partition_expression = v.into();
            self
        }

        /// Sets the value of [cluster_expressions][crate::model::compilation_result_action::Relation::cluster_expressions].
        pub fn set_cluster_expressions<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.cluster_expressions = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [partition_expiration_days][crate::model::compilation_result_action::Relation::partition_expiration_days].
        pub fn set_partition_expiration_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.partition_expiration_days = v.into();
            self
        }

        /// Sets the value of [require_partition_filter][crate::model::compilation_result_action::Relation::require_partition_filter].
        pub fn set_require_partition_filter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.require_partition_filter = v.into();
            self
        }

        /// Sets the value of [additional_options][crate::model::compilation_result_action::Relation::additional_options].
        pub fn set_additional_options<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.additional_options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }
    }

    impl wkt::message::Message for Relation {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation"
        }
    }

    /// Defines additional types related to [Relation].
    pub mod relation {
        #[allow(unused_imports)]
        use super::*;

        /// Contains settings for relations of type `INCREMENTAL_TABLE`.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct IncrementalTableConfig {
            /// The SELECT query which returns rows which should be inserted into the
            /// relation if it already exists and is not being refreshed.
            pub incremental_select_query: std::string::String,

            /// Whether this table should be protected from being refreshed.
            pub refresh_disabled: bool,

            /// A set of columns or SQL expressions used to define row uniqueness.
            /// If any duplicates are discovered (as defined by `unique_key_parts`),
            /// only the newly selected rows (as defined by `incremental_select_query`)
            /// will be included in the relation.
            pub unique_key_parts: std::vec::Vec<std::string::String>,

            /// A SQL expression conditional used to limit the set of existing rows
            /// considered for a merge operation (see `unique_key_parts` for more
            /// information).
            pub update_partition_filter: std::string::String,

            /// SQL statements to be executed before inserting new rows into the
            /// relation.
            pub incremental_pre_operations: std::vec::Vec<std::string::String>,

            /// SQL statements to be executed after inserting new rows into the
            /// relation.
            pub incremental_post_operations: std::vec::Vec<std::string::String>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl IncrementalTableConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [incremental_select_query][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_select_query].
            pub fn set_incremental_select_query<T: std::convert::Into<std::string::String>>(
                mut self,
                v: T,
            ) -> Self {
                self.incremental_select_query = v.into();
                self
            }

            /// Sets the value of [refresh_disabled][crate::model::compilation_result_action::relation::IncrementalTableConfig::refresh_disabled].
            pub fn set_refresh_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
                self.refresh_disabled = v.into();
                self
            }

            /// Sets the value of [unique_key_parts][crate::model::compilation_result_action::relation::IncrementalTableConfig::unique_key_parts].
            pub fn set_unique_key_parts<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<std::string::String>,
            {
                use std::iter::Iterator;
                self.unique_key_parts = v.into_iter().map(|i| i.into()).collect();
                self
            }

            /// Sets the value of [update_partition_filter][crate::model::compilation_result_action::relation::IncrementalTableConfig::update_partition_filter].
            pub fn set_update_partition_filter<T: std::convert::Into<std::string::String>>(
                mut self,
                v: T,
            ) -> Self {
                self.update_partition_filter = v.into();
                self
            }

            /// Sets the value of [incremental_pre_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_pre_operations].
            pub fn set_incremental_pre_operations<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<std::string::String>,
            {
                use std::iter::Iterator;
                self.incremental_pre_operations = v.into_iter().map(|i| i.into()).collect();
                self
            }

            /// Sets the value of [incremental_post_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_post_operations].
            pub fn set_incremental_post_operations<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<std::string::String>,
            {
                use std::iter::Iterator;
                self.incremental_post_operations = v.into_iter().map(|i| i.into()).collect();
                self
            }
        }

        impl wkt::message::Message for IncrementalTableConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation.IncrementalTableConfig"
            }
        }

        /// Indicates the type of this relation.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum RelationType {
            /// Default value. This value is unused.
            Unspecified,
            /// The relation is a table.
            Table,
            /// The relation is a view.
            View,
            /// The relation is an incrementalized table.
            IncrementalTable,
            /// The relation is a materialized view.
            MaterializedView,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [RelationType::value] or
            /// [RelationType::name].
            UnknownValue(relation_type::UnknownValue),
        }

        #[doc(hidden)]
        pub mod relation_type {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl RelationType {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Table => std::option::Option::Some(1),
                    Self::View => std::option::Option::Some(2),
                    Self::IncrementalTable => std::option::Option::Some(3),
                    Self::MaterializedView => std::option::Option::Some(4),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("RELATION_TYPE_UNSPECIFIED"),
                    Self::Table => std::option::Option::Some("TABLE"),
                    Self::View => std::option::Option::Some("VIEW"),
                    Self::IncrementalTable => std::option::Option::Some("INCREMENTAL_TABLE"),
                    Self::MaterializedView => std::option::Option::Some("MATERIALIZED_VIEW"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for RelationType {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for RelationType {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for RelationType {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Table,
                    2 => Self::View,
                    3 => Self::IncrementalTable,
                    4 => Self::MaterializedView,
                    _ => Self::UnknownValue(relation_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for RelationType {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "RELATION_TYPE_UNSPECIFIED" => Self::Unspecified,
                    "TABLE" => Self::Table,
                    "VIEW" => Self::View,
                    "INCREMENTAL_TABLE" => Self::IncrementalTable,
                    "MATERIALIZED_VIEW" => Self::MaterializedView,
                    _ => Self::UnknownValue(relation_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for RelationType {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Table => serializer.serialize_i32(1),
                    Self::View => serializer.serialize_i32(2),
                    Self::IncrementalTable => serializer.serialize_i32(3),
                    Self::MaterializedView => serializer.serialize_i32(4),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for RelationType {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<RelationType>::new(
                    ".google.cloud.dataform.v1.CompilationResultAction.Relation.RelationType",
                ))
            }
        }
    }

    /// Represents a list of arbitrary database operations.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Operations {
        /// A list of actions that this action depends on.
        pub dependency_targets: std::vec::Vec<crate::model::Target>,

        /// Whether this action is disabled (i.e. should not be run).
        pub disabled: bool,

        /// Arbitrary, user-defined tags on this action.
        pub tags: std::vec::Vec<std::string::String>,

        /// Descriptor for any output relation and its columns. Only set if
        /// `has_output` is true.
        pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,

        /// A list of arbitrary SQL statements that will be executed without
        /// alteration.
        pub queries: std::vec::Vec<std::string::String>,

        /// Whether these operations produce an output relation.
        pub has_output: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Operations {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Operations::dependency_targets].
        pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Target>,
        {
            use std::iter::Iterator;
            self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [disabled][crate::model::compilation_result_action::Operations::disabled].
        pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.disabled = v.into();
            self
        }

        /// Sets the value of [tags][crate::model::compilation_result_action::Operations::tags].
        pub fn set_tags<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.tags = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
        pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
        pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = v.map(|x| x.into());
            self
        }

        /// Sets the value of [queries][crate::model::compilation_result_action::Operations::queries].
        pub fn set_queries<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.queries = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [has_output][crate::model::compilation_result_action::Operations::has_output].
        pub fn set_has_output<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.has_output = v.into();
            self
        }
    }

    impl wkt::message::Message for Operations {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Operations"
        }
    }

    /// Represents an assertion upon a SQL query which is required return zero
    /// rows.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Assertion {
        /// A list of actions that this action depends on.
        pub dependency_targets: std::vec::Vec<crate::model::Target>,

        /// The parent action of this assertion. Only set if this assertion was
        /// automatically generated.
        pub parent_action: std::option::Option<crate::model::Target>,

        /// Whether this action is disabled (i.e. should not be run).
        pub disabled: bool,

        /// Arbitrary, user-defined tags on this action.
        pub tags: std::vec::Vec<std::string::String>,

        /// The SELECT query which must return zero rows in order for this assertion
        /// to succeed.
        pub select_query: std::string::String,

        /// Descriptor for the assertion's automatically-generated view and its
        /// columns.
        pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Assertion {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Assertion::dependency_targets].
        pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Target>,
        {
            use std::iter::Iterator;
            self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
        pub fn set_parent_action<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Target>,
        {
            self.parent_action = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
        pub fn set_or_clear_parent_action<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Target>,
        {
            self.parent_action = v.map(|x| x.into());
            self
        }

        /// Sets the value of [disabled][crate::model::compilation_result_action::Assertion::disabled].
        pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.disabled = v.into();
            self
        }

        /// Sets the value of [tags][crate::model::compilation_result_action::Assertion::tags].
        pub fn set_tags<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.tags = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [select_query][crate::model::compilation_result_action::Assertion::select_query].
        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.select_query = v.into();
            self
        }

        /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
        pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
        pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Assertion {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Assertion"
        }
    }

    /// Represents a relation which is not managed by Dataform but which may be
    /// referenced by Dataform actions.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Declaration {
        /// Descriptor for the relation and its columns. Used as documentation only,
        /// i.e. values here will result in no changes to the relation's metadata.
        pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Declaration {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
        pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
        pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RelationDescriptor>,
        {
            self.relation_descriptor = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Declaration {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Declaration"
        }
    }

    /// Represents a notebook.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Notebook {
        /// A list of actions that this action depends on.
        pub dependency_targets: std::vec::Vec<crate::model::Target>,

        /// Whether this action is disabled (i.e. should not be run).
        pub disabled: bool,

        /// The contents of the notebook.
        pub contents: std::string::String,

        /// Arbitrary, user-defined tags on this action.
        pub tags: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Notebook {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Notebook::dependency_targets].
        pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Target>,
        {
            use std::iter::Iterator;
            self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [disabled][crate::model::compilation_result_action::Notebook::disabled].
        pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.disabled = v.into();
            self
        }

        /// Sets the value of [contents][crate::model::compilation_result_action::Notebook::contents].
        pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.contents = v.into();
            self
        }

        /// Sets the value of [tags][crate::model::compilation_result_action::Notebook::tags].
        pub fn set_tags<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.tags = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for Notebook {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Notebook"
        }
    }

    /// Defines a compiled Data Preparation entity
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DataPreparation {
        /// A list of actions that this action depends on.
        pub dependency_targets: std::vec::Vec<crate::model::Target>,

        /// Whether this action is disabled (i.e. should not be run).
        pub disabled: bool,

        /// Arbitrary, user-defined tags on this action.
        pub tags: std::vec::Vec<std::string::String>,

        /// The definition for the data preparation.
        pub definition: std::option::Option<
            crate::model::compilation_result_action::data_preparation::Definition,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DataPreparation {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [dependency_targets][crate::model::compilation_result_action::DataPreparation::dependency_targets].
        pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Target>,
        {
            use std::iter::Iterator;
            self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [disabled][crate::model::compilation_result_action::DataPreparation::disabled].
        pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.disabled = v.into();
            self
        }

        /// Sets the value of [tags][crate::model::compilation_result_action::DataPreparation::tags].
        pub fn set_tags<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.tags = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition].
        ///
        /// Note that all the setters affecting `definition` are mutually
        /// exclusive.
        pub fn set_definition<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::compilation_result_action::data_preparation::Definition,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.definition = v.into();
            self
        }

        /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
        /// if it holds a `ContentsYaml`, `None` if the field is not set or
        /// holds a different branch.
        pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
            #[allow(unreachable_patterns)]
            self.definition.as_ref().and_then(|v| match v {
                crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
        /// to hold a `ContentsYaml`.
        ///
        /// Note that all the setters affecting `definition` are
        /// mutually exclusive.
        pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.definition = std::option::Option::Some(
                crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(
                    v.into(),
                ),
            );
            self
        }

        /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
        /// if it holds a `ContentsSql`, `None` if the field is not set or
        /// holds a different branch.
        pub fn contents_sql(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<
                crate::model::compilation_result_action::data_preparation::SqlDefinition,
            >,
        > {
            #[allow(unreachable_patterns)]
            self.definition.as_ref().and_then(|v| match v {
                crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
        /// to hold a `ContentsSql`.
        ///
        /// Note that all the setters affecting `definition` are
        /// mutually exclusive.
        pub fn set_contents_sql<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::compilation_result_action::data_preparation::SqlDefinition,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.definition = std::option::Option::Some(
                crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(
                    v.into(),
                ),
            );
            self
        }
    }

    impl wkt::message::Message for DataPreparation {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation"
        }
    }

    /// Defines additional types related to [DataPreparation].
    pub mod data_preparation {
        #[allow(unused_imports)]
        use super::*;

        /// Definition of a SQL Data Preparation
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct SqlDefinition {
            /// The SQL query representing the data preparation steps. Formatted as a
            /// Pipe SQL query statement.
            pub query: std::string::String,

            /// Error table configuration,
            pub error_table: std::option::Option<
                crate::model::compilation_result_action::data_preparation::ErrorTable,
            >,

            /// Load configuration.
            pub load: std::option::Option<crate::model::compilation_result_action::LoadConfig>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl SqlDefinition {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [query][crate::model::compilation_result_action::data_preparation::SqlDefinition::query].
            pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
                self.query = v.into();
                self
            }

            /// Sets the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
            pub fn set_error_table<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<
                        crate::model::compilation_result_action::data_preparation::ErrorTable,
                    >,
            {
                self.error_table = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
            pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<
                        crate::model::compilation_result_action::data_preparation::ErrorTable,
                    >,
            {
                self.error_table = v.map(|x| x.into());
                self
            }

            /// Sets the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
            pub fn set_load<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
            {
                self.load = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
            pub fn set_or_clear_load<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
            {
                self.load = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for SqlDefinition {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.SqlDefinition"
            }
        }

        /// Error table information, used to write error data into a BigQuery
        /// table.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct ErrorTable {
            /// Error Table target.
            pub target: std::option::Option<crate::model::Target>,

            /// Error table partition expiration in days. Only positive values are
            /// allowed.
            pub retention_days: i32,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl ErrorTable {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
            pub fn set_target<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::Target>,
            {
                self.target = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
            pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::Target>,
            {
                self.target = v.map(|x| x.into());
                self
            }

            /// Sets the value of [retention_days][crate::model::compilation_result_action::data_preparation::ErrorTable::retention_days].
            pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
                self.retention_days = v.into();
                self
            }
        }

        impl wkt::message::Message for ErrorTable {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.ErrorTable"
            }
        }

        /// The definition for the data preparation.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Definition {
            /// The data preparation definition, stored as a YAML string.
            ContentsYaml(std::string::String),
            /// SQL definition for a Data Preparation. Contains a SQL query and
            /// additional context information.
            ContentsSql(
                std::boxed::Box<
                    crate::model::compilation_result_action::data_preparation::SqlDefinition,
                >,
            ),
        }
    }

    /// Simplified load configuration for actions
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct LoadConfig {
        /// Load mode
        pub mode: std::option::Option<crate::model::compilation_result_action::load_config::Mode>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl LoadConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode].
        ///
        /// Note that all the setters affecting `mode` are mutually
        /// exclusive.
        pub fn set_mode<
            T: std::convert::Into<
                    std::option::Option<crate::model::compilation_result_action::load_config::Mode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.mode = v.into();
            self
        }

        /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// if it holds a `Replace`, `None` if the field is not set or
        /// holds a different branch.
        pub fn replace(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
        > {
            #[allow(unreachable_patterns)]
            self.mode.as_ref().and_then(|v| match v {
                crate::model::compilation_result_action::load_config::Mode::Replace(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// to hold a `Replace`.
        ///
        /// Note that all the setters affecting `mode` are
        /// mutually exclusive.
        pub fn set_replace<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.mode = std::option::Option::Some(
                crate::model::compilation_result_action::load_config::Mode::Replace(v.into()),
            );
            self
        }

        /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// if it holds a `Append`, `None` if the field is not set or
        /// holds a different branch.
        pub fn append(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
        > {
            #[allow(unreachable_patterns)]
            self.mode.as_ref().and_then(|v| match v {
                crate::model::compilation_result_action::load_config::Mode::Append(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// to hold a `Append`.
        ///
        /// Note that all the setters affecting `mode` are
        /// mutually exclusive.
        pub fn set_append<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.mode = std::option::Option::Some(
                crate::model::compilation_result_action::load_config::Mode::Append(v.into()),
            );
            self
        }

        /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// if it holds a `Maximum`, `None` if the field is not set or
        /// holds a different branch.
        pub fn maximum(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
        > {
            #[allow(unreachable_patterns)]
            self.mode.as_ref().and_then(|v| match v {
                crate::model::compilation_result_action::load_config::Mode::Maximum(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// to hold a `Maximum`.
        ///
        /// Note that all the setters affecting `mode` are
        /// mutually exclusive.
        pub fn set_maximum<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.mode = std::option::Option::Some(
                crate::model::compilation_result_action::load_config::Mode::Maximum(v.into()),
            );
            self
        }

        /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// if it holds a `Unique`, `None` if the field is not set or
        /// holds a different branch.
        pub fn unique(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
        > {
            #[allow(unreachable_patterns)]
            self.mode.as_ref().and_then(|v| match v {
                crate::model::compilation_result_action::load_config::Mode::Unique(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
        /// to hold a `Unique`.
        ///
        /// Note that all the setters affecting `mode` are
        /// mutually exclusive.
        pub fn set_unique<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.mode = std::option::Option::Some(
                crate::model::compilation_result_action::load_config::Mode::Unique(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for LoadConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.LoadConfig"
        }
    }

    /// Defines additional types related to [LoadConfig].
    pub mod load_config {
        #[allow(unused_imports)]
        use super::*;

        /// Load mode
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Mode {
            /// Replace destination table
            Replace(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
            /// Append into destination table
            Append(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
            /// Insert records where the value exceeds the previous maximum value for a
            /// column in the destination table
            Maximum(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
            /// Insert records where the value of a column is not already present in
            /// the destination table
            Unique(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
        }
    }

    /// Simple load definition
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SimpleLoadMode {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SimpleLoadMode {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for SimpleLoadMode {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.SimpleLoadMode"
        }
    }

    /// Load definition for incremental load modes
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct IncrementalLoadMode {
        /// Column name for incremental load modes
        pub column: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl IncrementalLoadMode {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [column][crate::model::compilation_result_action::IncrementalLoadMode::column].
        pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.column = v.into();
            self
        }
    }

    impl wkt::message::Message for IncrementalLoadMode {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.IncrementalLoadMode"
        }
    }

    /// The compiled object.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CompiledObject {
        /// The database relation created/updated by this action.
        Relation(std::boxed::Box<crate::model::compilation_result_action::Relation>),
        /// The database operations executed by this action.
        Operations(std::boxed::Box<crate::model::compilation_result_action::Operations>),
        /// The assertion executed by this action.
        Assertion(std::boxed::Box<crate::model::compilation_result_action::Assertion>),
        /// The declaration declared by this action.
        Declaration(std::boxed::Box<crate::model::compilation_result_action::Declaration>),
        /// The notebook executed by this action.
        Notebook(std::boxed::Box<crate::model::compilation_result_action::Notebook>),
        /// The data preparation executed by this action.
        DataPreparation(std::boxed::Box<crate::model::compilation_result_action::DataPreparation>),
    }
}

/// `QueryCompilationResultActions` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryCompilationResultActionsRequest {
    /// Required. The compilation result's name.
    pub name: std::string::String,

    /// Optional. Maximum number of compilation results to return. The server may
    /// return fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous
    /// `QueryCompilationResultActions` call. Provide this to retrieve the
    /// subsequent page.
    ///
    /// When paginating, all other parameters provided to
    /// `QueryCompilationResultActions`, with the exception of `page_size`, must
    /// match the call that provided the page token.
    pub page_token: std::string::String,

    /// Optional. Optional filter for the returned list. Filtering is only
    /// currently supported on the `file_path` field.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryCompilationResultActionsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::QueryCompilationResultActionsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::QueryCompilationResultActionsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::QueryCompilationResultActionsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::QueryCompilationResultActionsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for QueryCompilationResultActionsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsRequest"
    }
}

/// `QueryCompilationResultActions` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryCompilationResultActionsResponse {
    /// List of compilation result actions.
    pub compilation_result_actions: std::vec::Vec<crate::model::CompilationResultAction>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryCompilationResultActionsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [compilation_result_actions][crate::model::QueryCompilationResultActionsResponse::compilation_result_actions].
    pub fn set_compilation_result_actions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::CompilationResultAction>,
    {
        use std::iter::Iterator;
        self.compilation_result_actions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::QueryCompilationResultActionsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryCompilationResultActionsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for QueryCompilationResultActionsResponse {
    type PageItem = crate::model::CompilationResultAction;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.compilation_result_actions
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Represents a Dataform workflow configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowConfig {
    /// Identifier. The workflow config's name.
    pub name: std::string::String,

    /// Required. The name of the release config whose release_compilation_result
    /// should be executed. Must be in the format
    /// `projects/*/locations/*/repositories/*/releaseConfigs/*`.
    pub release_config: std::string::String,

    /// Optional. If left unset, a default InvocationConfig will be used.
    pub invocation_config: std::option::Option<crate::model::InvocationConfig>,

    /// Optional. Optional schedule (in cron format) for automatic execution of
    /// this workflow config.
    pub cron_schedule: std::string::String,

    /// Optional. Specifies the time zone to be used when interpreting
    /// cron_schedule. Must be a time zone name from the time zone database
    /// (<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>). If left
    /// unspecified, the default is UTC.
    pub time_zone: std::string::String,

    /// Output only. Records of the 10 most recent scheduled execution attempts,
    /// ordered in descending order of `execution_time`. Updated whenever automatic
    /// creation of a workflow invocation is triggered by cron_schedule.
    pub recent_scheduled_execution_records:
        std::vec::Vec<crate::model::workflow_config::ScheduledExecutionRecord>,

    /// Optional. Disables automatic creation of workflow invocations.
    pub disabled: bool,

    /// Output only. The timestamp of when the WorkflowConfig was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The timestamp of when the WorkflowConfig was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WorkflowConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::WorkflowConfig::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [release_config][crate::model::WorkflowConfig::release_config].
    pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.release_config = v.into();
        self
    }

    /// Sets the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
    pub fn set_invocation_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InvocationConfig>,
    {
        self.invocation_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
    pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InvocationConfig>,
    {
        self.invocation_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [cron_schedule][crate::model::WorkflowConfig::cron_schedule].
    pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.cron_schedule = v.into();
        self
    }

    /// Sets the value of [time_zone][crate::model::WorkflowConfig::time_zone].
    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.time_zone = v.into();
        self
    }

    /// Sets the value of [recent_scheduled_execution_records][crate::model::WorkflowConfig::recent_scheduled_execution_records].
    pub fn set_recent_scheduled_execution_records<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::workflow_config::ScheduledExecutionRecord>,
    {
        use std::iter::Iterator;
        self.recent_scheduled_execution_records = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [disabled][crate::model::WorkflowConfig::disabled].
    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.disabled = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::WorkflowConfig::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::WorkflowConfig::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::WorkflowConfig::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::WorkflowConfig::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for WorkflowConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig"
    }
}

/// Defines additional types related to [WorkflowConfig].
pub mod workflow_config {
    #[allow(unused_imports)]
    use super::*;

    /// A record of an attempt to create a workflow invocation for this workflow
    /// config.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ScheduledExecutionRecord {
        /// Output only. The timestamp of this execution attempt.
        pub execution_time: std::option::Option<wkt::Timestamp>,

        /// The result of this execution attempt.
        pub result:
            std::option::Option<crate::model::workflow_config::scheduled_execution_record::Result>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ScheduledExecutionRecord {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
        pub fn set_execution_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.execution_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
        pub fn set_or_clear_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.execution_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result].
        ///
        /// Note that all the setters affecting `result` are mutually
        /// exclusive.
        pub fn set_result<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::workflow_config::scheduled_execution_record::Result,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.result = v.into();
            self
        }

        /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
        /// if it holds a `WorkflowInvocation`, `None` if the field is not set or
        /// holds a different branch.
        pub fn workflow_invocation(&self) -> std::option::Option<&std::string::String> {
            #[allow(unreachable_patterns)]
            self.result.as_ref().and_then(|v| match v {
                crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
        /// to hold a `WorkflowInvocation`.
        ///
        /// Note that all the setters affecting `result` are
        /// mutually exclusive.
        pub fn set_workflow_invocation<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.result = std::option::Option::Some(
                crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(
                    v.into()
                )
            );
            self
        }

        /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
        /// if it holds a `ErrorStatus`, `None` if the field is not set or
        /// holds a different branch.
        pub fn error_status(&self) -> std::option::Option<&std::boxed::Box<rpc::model::Status>> {
            #[allow(unreachable_patterns)]
            self.result.as_ref().and_then(|v| match v {
                crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
                    v,
                ) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
        /// to hold a `ErrorStatus`.
        ///
        /// Note that all the setters affecting `result` are
        /// mutually exclusive.
        pub fn set_error_status<T: std::convert::Into<std::boxed::Box<rpc::model::Status>>>(
            mut self,
            v: T,
        ) -> Self {
            self.result = std::option::Option::Some(
                crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
                    v.into(),
                ),
            );
            self
        }
    }

    impl wkt::message::Message for ScheduledExecutionRecord {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig.ScheduledExecutionRecord"
        }
    }

    /// Defines additional types related to [ScheduledExecutionRecord].
    pub mod scheduled_execution_record {
        #[allow(unused_imports)]
        use super::*;

        /// The result of this execution attempt.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Result {
            /// The name of the created workflow invocation, if one was successfully
            /// created. Must be in the format
            /// `projects/*/locations/*/repositories/*/workflowInvocations/*`.
            WorkflowInvocation(std::string::String),
            /// The error status encountered upon this attempt to create the
            /// workflow invocation, if the attempt was unsuccessful.
            ErrorStatus(std::boxed::Box<rpc::model::Status>),
        }
    }
}

/// Includes various configuration options for a workflow invocation.
/// If both `included_targets` and `included_tags` are unset, all actions
/// will be included.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InvocationConfig {
    /// Optional. The set of action identifiers to include.
    pub included_targets: std::vec::Vec<crate::model::Target>,

    /// Optional. The set of tags to include.
    pub included_tags: std::vec::Vec<std::string::String>,

    /// Optional. When set to true, transitive dependencies of included actions
    /// will be executed.
    pub transitive_dependencies_included: bool,

    /// Optional. When set to true, transitive dependents of included actions will
    /// be executed.
    pub transitive_dependents_included: bool,

    /// Optional. When set to true, any incremental tables will be fully refreshed.
    pub fully_refresh_incremental_tables_enabled: bool,

    /// Optional. The service account to run workflow invocations under.
    pub service_account: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InvocationConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [included_targets][crate::model::InvocationConfig::included_targets].
    pub fn set_included_targets<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Target>,
    {
        use std::iter::Iterator;
        self.included_targets = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [included_tags][crate::model::InvocationConfig::included_tags].
    pub fn set_included_tags<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.included_tags = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [transitive_dependencies_included][crate::model::InvocationConfig::transitive_dependencies_included].
    pub fn set_transitive_dependencies_included<T: std::convert::Into<bool>>(
        mut self,
        v: T,
    ) -> Self {
        self.transitive_dependencies_included = v.into();
        self
    }

    /// Sets the value of [transitive_dependents_included][crate::model::InvocationConfig::transitive_dependents_included].
    pub fn set_transitive_dependents_included<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.transitive_dependents_included = v.into();
        self
    }

    /// Sets the value of [fully_refresh_incremental_tables_enabled][crate::model::InvocationConfig::fully_refresh_incremental_tables_enabled].
    pub fn set_fully_refresh_incremental_tables_enabled<T: std::convert::Into<bool>>(
        mut self,
        v: T,
    ) -> Self {
        self.fully_refresh_incremental_tables_enabled = v.into();
        self
    }

    /// Sets the value of [service_account][crate::model::InvocationConfig::service_account].
    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_account = v.into();
        self
    }
}

impl wkt::message::Message for InvocationConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.InvocationConfig"
    }
}

/// `ListWorkflowConfigs` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowConfigsRequest {
    /// Required. The repository in which to list workflow configs. Must be in the
    /// format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Optional. Maximum number of workflow configs to return. The server may
    /// return fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `ListWorkflowConfigs` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListWorkflowConfigs`,
    /// with the exception of `page_size`, must match the call that provided the
    /// page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkflowConfigsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListWorkflowConfigsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListWorkflowConfigsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListWorkflowConfigsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListWorkflowConfigsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsRequest"
    }
}

/// `ListWorkflowConfigs` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowConfigsResponse {
    /// List of workflow configs.
    pub workflow_configs: std::vec::Vec<crate::model::WorkflowConfig>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations which could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkflowConfigsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workflow_configs][crate::model::ListWorkflowConfigsResponse::workflow_configs].
    pub fn set_workflow_configs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::WorkflowConfig>,
    {
        use std::iter::Iterator;
        self.workflow_configs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListWorkflowConfigsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListWorkflowConfigsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListWorkflowConfigsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListWorkflowConfigsResponse {
    type PageItem = crate::model::WorkflowConfig;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.workflow_configs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// `GetWorkflowConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWorkflowConfigRequest {
    /// Required. The workflow config's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetWorkflowConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetWorkflowConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetWorkflowConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowConfigRequest"
    }
}

/// `CreateWorkflowConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkflowConfigRequest {
    /// Required. The repository in which to create the workflow config. Must be in
    /// the format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Required. The workflow config to create.
    pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,

    /// Required. The ID to use for the workflow config, which will become the
    /// final component of the workflow config's resource name.
    pub workflow_config_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateWorkflowConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateWorkflowConfigRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
    pub fn set_workflow_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::WorkflowConfig>,
    {
        self.workflow_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
    pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::WorkflowConfig>,
    {
        self.workflow_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [workflow_config_id][crate::model::CreateWorkflowConfigRequest::workflow_config_id].
    pub fn set_workflow_config_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.workflow_config_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateWorkflowConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowConfigRequest"
    }
}

/// `UpdateWorkflowConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateWorkflowConfigRequest {
    /// Optional. Specifies the fields to be updated in the workflow config. If
    /// left unset, all fields will be updated.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The workflow config to update.
    pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateWorkflowConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
    pub fn set_workflow_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::WorkflowConfig>,
    {
        self.workflow_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
    pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::WorkflowConfig>,
    {
        self.workflow_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateWorkflowConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.UpdateWorkflowConfigRequest"
    }
}

/// `DeleteWorkflowConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkflowConfigRequest {
    /// Required. The workflow config's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteWorkflowConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteWorkflowConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteWorkflowConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowConfigRequest"
    }
}

/// Represents a single invocation of a compilation result.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowInvocation {
    /// Output only. The workflow invocation's name.
    pub name: std::string::String,

    /// Immutable. If left unset, a default InvocationConfig will be used.
    pub invocation_config: std::option::Option<crate::model::InvocationConfig>,

    /// Output only. This workflow invocation's current state.
    pub state: crate::model::workflow_invocation::State,

    /// Output only. This workflow invocation's timing details.
    pub invocation_timing: std::option::Option<gtype::model::Interval>,

    /// Output only. The resolved compilation result that was used to create this
    /// invocation. Will be in the format
    /// `projects/*/locations/*/repositories/*/compilationResults/*`.
    pub resolved_compilation_result: std::string::String,

    /// Output only. Only set if the repository has a KMS Key.
    pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    /// The source of the compilation result to use for this invocation.
    pub compilation_source:
        std::option::Option<crate::model::workflow_invocation::CompilationSource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WorkflowInvocation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::WorkflowInvocation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
    pub fn set_invocation_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InvocationConfig>,
    {
        self.invocation_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
    pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InvocationConfig>,
    {
        self.invocation_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::WorkflowInvocation::state].
    pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
    pub fn set_invocation_timing<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<gtype::model::Interval>,
    {
        self.invocation_timing = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
    pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<gtype::model::Interval>,
    {
        self.invocation_timing = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resolved_compilation_result][crate::model::WorkflowInvocation::resolved_compilation_result].
    pub fn set_resolved_compilation_result<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.resolved_compilation_result = v.into();
        self
    }

    /// Sets the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
    pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
    pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DataEncryptionState>,
    {
        self.data_encryption_state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source].
    ///
    /// Note that all the setters affecting `compilation_source` are mutually
    /// exclusive.
    pub fn set_compilation_source<
        T: std::convert::Into<
                std::option::Option<crate::model::workflow_invocation::CompilationSource>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compilation_source = v.into();
        self
    }

    /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
    /// if it holds a `CompilationResult`, `None` if the field is not set or
    /// holds a different branch.
    pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.compilation_source.as_ref().and_then(|v| match v {
            crate::model::workflow_invocation::CompilationSource::CompilationResult(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
    /// to hold a `CompilationResult`.
    ///
    /// Note that all the setters affecting `compilation_source` are
    /// mutually exclusive.
    pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.compilation_source = std::option::Option::Some(
            crate::model::workflow_invocation::CompilationSource::CompilationResult(v.into()),
        );
        self
    }

    /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
    /// if it holds a `WorkflowConfig`, `None` if the field is not set or
    /// holds a different branch.
    pub fn workflow_config(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.compilation_source.as_ref().and_then(|v| match v {
            crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
    /// to hold a `WorkflowConfig`.
    ///
    /// Note that all the setters affecting `compilation_source` are
    /// mutually exclusive.
    pub fn set_workflow_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.compilation_source = std::option::Option::Some(
            crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v.into()),
        );
        self
    }
}

impl wkt::message::Message for WorkflowInvocation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocation"
    }
}

/// Defines additional types related to [WorkflowInvocation].
pub mod workflow_invocation {
    #[allow(unused_imports)]
    use super::*;

    /// Represents the current state of a workflow invocation.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Default value. This value is unused.
        Unspecified,
        /// The workflow invocation is currently running.
        Running,
        /// The workflow invocation succeeded. A terminal state.
        Succeeded,
        /// The workflow invocation was cancelled. A terminal state.
        Cancelled,
        /// The workflow invocation failed. A terminal state.
        Failed,
        /// The workflow invocation is being cancelled, but some actions are still
        /// running.
        Canceling,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Running => std::option::Option::Some(1),
                Self::Succeeded => std::option::Option::Some(2),
                Self::Cancelled => std::option::Option::Some(3),
                Self::Failed => std::option::Option::Some(4),
                Self::Canceling => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Cancelled => std::option::Option::Some("CANCELLED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Canceling => std::option::Option::Some("CANCELING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Running,
                2 => Self::Succeeded,
                3 => Self::Cancelled,
                4 => Self::Failed,
                5 => Self::Canceling,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "RUNNING" => Self::Running,
                "SUCCEEDED" => Self::Succeeded,
                "CANCELLED" => Self::Cancelled,
                "FAILED" => Self::Failed,
                "CANCELING" => Self::Canceling,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Running => serializer.serialize_i32(1),
                Self::Succeeded => serializer.serialize_i32(2),
                Self::Cancelled => serializer.serialize_i32(3),
                Self::Failed => serializer.serialize_i32(4),
                Self::Canceling => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.dataform.v1.WorkflowInvocation.State",
            ))
        }
    }

    /// The source of the compilation result to use for this invocation.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CompilationSource {
        /// Immutable. The name of the compilation result to use for this invocation.
        /// Must be in the format
        /// `projects/*/locations/*/repositories/*/compilationResults/*`.
        CompilationResult(std::string::String),
        /// Immutable. The name of the workflow config to invoke. Must be in the
        /// format `projects/*/locations/*/repositories/*/workflowConfigs/*`.
        WorkflowConfig(std::string::String),
    }
}

/// `ListWorkflowInvocations` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowInvocationsRequest {
    /// Required. The parent resource of the WorkflowInvocation type. Must be in
    /// the format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Optional. Maximum number of workflow invocations to return. The server may
    /// return fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous `ListWorkflowInvocations`
    /// call. Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to
    /// `ListWorkflowInvocations`, with the exception of `page_size`, must match
    /// the call that provided the page token.
    pub page_token: std::string::String,

    /// Optional. This field only supports ordering by `name`. If unspecified, the
    /// server will choose the ordering. If specified, the default order is
    /// ascending for the `name` field.
    pub order_by: std::string::String,

    /// Optional. Filter for the returned list.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkflowInvocationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListWorkflowInvocationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListWorkflowInvocationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListWorkflowInvocationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListWorkflowInvocationsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListWorkflowInvocationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListWorkflowInvocationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsRequest"
    }
}

/// `ListWorkflowInvocations` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowInvocationsResponse {
    /// List of workflow invocations.
    pub workflow_invocations: std::vec::Vec<crate::model::WorkflowInvocation>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations which could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkflowInvocationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workflow_invocations][crate::model::ListWorkflowInvocationsResponse::workflow_invocations].
    pub fn set_workflow_invocations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::WorkflowInvocation>,
    {
        use std::iter::Iterator;
        self.workflow_invocations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListWorkflowInvocationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListWorkflowInvocationsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListWorkflowInvocationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListWorkflowInvocationsResponse {
    type PageItem = crate::model::WorkflowInvocation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.workflow_invocations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// `GetWorkflowInvocation` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWorkflowInvocationRequest {
    /// Required. The workflow invocation resource's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetWorkflowInvocationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetWorkflowInvocationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetWorkflowInvocationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowInvocationRequest"
    }
}

/// `CreateWorkflowInvocation` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkflowInvocationRequest {
    /// Required. The repository in which to create the workflow invocation. Must
    /// be in the format `projects/*/locations/*/repositories/*`.
    pub parent: std::string::String,

    /// Required. The workflow invocation resource to create.
    pub workflow_invocation: std::option::Option<crate::model::WorkflowInvocation>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateWorkflowInvocationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateWorkflowInvocationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
    pub fn set_workflow_invocation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::WorkflowInvocation>,
    {
        self.workflow_invocation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
    pub fn set_or_clear_workflow_invocation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::WorkflowInvocation>,
    {
        self.workflow_invocation = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateWorkflowInvocationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowInvocationRequest"
    }
}

/// `DeleteWorkflowInvocation` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkflowInvocationRequest {
    /// Required. The workflow invocation resource's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteWorkflowInvocationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteWorkflowInvocationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteWorkflowInvocationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowInvocationRequest"
    }
}

/// `CancelWorkflowInvocation` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelWorkflowInvocationRequest {
    /// Required. The workflow invocation resource's name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CancelWorkflowInvocationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::CancelWorkflowInvocationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for CancelWorkflowInvocationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationRequest"
    }
}

/// `CancelWorkflowInvocation` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelWorkflowInvocationResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CancelWorkflowInvocationResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for CancelWorkflowInvocationResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationResponse"
    }
}

/// Represents a single action in a workflow invocation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowInvocationAction {
    /// Output only. This action's identifier. Unique within the workflow
    /// invocation.
    pub target: std::option::Option<crate::model::Target>,

    /// Output only. The action's identifier if the project had been compiled
    /// without any overrides configured. Unique within the compilation result.
    pub canonical_target: std::option::Option<crate::model::Target>,

    /// Output only. This action's current state.
    pub state: crate::model::workflow_invocation_action::State,

    /// Output only. If and only if action's state is FAILED a failure reason is
    /// set.
    pub failure_reason: std::string::String,

    /// Output only. This action's timing details.
    /// `start_time` will be set if the action is in [RUNNING, SUCCEEDED,
    /// CANCELLED, FAILED] state.
    /// `end_time` will be set if the action is in [SUCCEEDED, CANCELLED, FAILED]
    /// state.
    pub invocation_timing: std::option::Option<gtype::model::Interval>,

    /// Output only. All the metadata information that is used internally to serve
    /// the resource. For example: timestamps, flags, status fields, etc. The
    /// format of this field is a JSON string.
    pub internal_metadata: std::option::Option<std::string::String>,

    /// The action's details.
    pub action: std::option::Option<crate::model::workflow_invocation_action::Action>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WorkflowInvocationAction {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [target][crate::model::WorkflowInvocationAction::target].
    pub fn set_target<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.target = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [target][crate::model::WorkflowInvocationAction::target].
    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.target = v.map(|x| x.into());
        self
    }

    /// Sets the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
    pub fn set_canonical_target<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.canonical_target = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
    pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Target>,
    {
        self.canonical_target = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::WorkflowInvocationAction::state].
    pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation_action::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [failure_reason][crate::model::WorkflowInvocationAction::failure_reason].
    pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.failure_reason = v.into();
        self
    }

    /// Sets the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
    pub fn set_invocation_timing<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<gtype::model::Interval>,
    {
        self.invocation_timing = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
    pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<gtype::model::Interval>,
    {
        self.invocation_timing = v.map(|x| x.into());
        self
    }

    /// Sets the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
    pub fn set_internal_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
    pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.internal_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [action][crate::model::WorkflowInvocationAction::action].
    ///
    /// Note that all the setters affecting `action` are mutually
    /// exclusive.
    pub fn set_action<
        T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::Action>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.action = v.into();
        self
    }

    /// The value of [action][crate::model::WorkflowInvocationAction::action]
    /// if it holds a `BigqueryAction`, `None` if the field is not set or
    /// holds a different branch.
    pub fn bigquery_action(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
    > {
        #[allow(unreachable_patterns)]
        self.action.as_ref().and_then(|v| match v {
            crate::model::workflow_invocation_action::Action::BigqueryAction(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
    /// to hold a `BigqueryAction`.
    ///
    /// Note that all the setters affecting `action` are
    /// mutually exclusive.
    pub fn set_bigquery_action<
        T: std::convert::Into<
                std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.action = std::option::Option::Some(
            crate::model::workflow_invocation_action::Action::BigqueryAction(v.into()),
        );
        self
    }

    /// The value of [action][crate::model::WorkflowInvocationAction::action]
    /// if it holds a `NotebookAction`, `None` if the field is not set or
    /// holds a different branch.
    pub fn notebook_action(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
    > {
        #[allow(unreachable_patterns)]
        self.action.as_ref().and_then(|v| match v {
            crate::model::workflow_invocation_action::Action::NotebookAction(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
    /// to hold a `NotebookAction`.
    ///
    /// Note that all the setters affecting `action` are
    /// mutually exclusive.
    pub fn set_notebook_action<
        T: std::convert::Into<
                std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.action = std::option::Option::Some(
            crate::model::workflow_invocation_action::Action::NotebookAction(v.into()),
        );
        self
    }

    /// The value of [action][crate::model::WorkflowInvocationAction::action]
    /// if it holds a `DataPreparationAction`, `None` if the field is not set or
    /// holds a different branch.
    pub fn data_preparation_action(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
    > {
        #[allow(unreachable_patterns)]
        self.action.as_ref().and_then(|v| match v {
            crate::model::workflow_invocation_action::Action::DataPreparationAction(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
    /// to hold a `DataPreparationAction`.
    ///
    /// Note that all the setters affecting `action` are
    /// mutually exclusive.
    pub fn set_data_preparation_action<
        T: std::convert::Into<
                std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.action = std::option::Option::Some(
            crate::model::workflow_invocation_action::Action::DataPreparationAction(v.into()),
        );
        self
    }
}

impl wkt::message::Message for WorkflowInvocationAction {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction"
    }
}

/// Defines additional types related to [WorkflowInvocationAction].
pub mod workflow_invocation_action {
    #[allow(unused_imports)]
    use super::*;

    /// Represents a workflow action that will run against BigQuery.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct BigQueryAction {
        /// Output only. The generated BigQuery SQL script that will be executed.
        pub sql_script: std::string::String,

        /// Output only. The ID of the BigQuery job that executed the SQL in
        /// sql_script. Only set once the job has started to run.
        pub job_id: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl BigQueryAction {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [sql_script][crate::model::workflow_invocation_action::BigQueryAction::sql_script].
        pub fn set_sql_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.sql_script = v.into();
            self
        }

        /// Sets the value of [job_id][crate::model::workflow_invocation_action::BigQueryAction::job_id].
        pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.job_id = v.into();
            self
        }
    }

    impl wkt::message::Message for BigQueryAction {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.BigQueryAction"
        }
    }

    /// Represents a workflow action that will run against a Notebook runtime.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct NotebookAction {
        /// Output only. The code contents of a Notebook to be run.
        pub contents: std::string::String,

        /// Output only. The ID of the Vertex job that executed the notebook in
        /// contents and also the ID used for the outputs created in Google Cloud
        /// Storage buckets. Only set once the job has started to run.
        pub job_id: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl NotebookAction {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [contents][crate::model::workflow_invocation_action::NotebookAction::contents].
        pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.contents = v.into();
            self
        }

        /// Sets the value of [job_id][crate::model::workflow_invocation_action::NotebookAction::job_id].
        pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.job_id = v.into();
            self
        }
    }

    impl wkt::message::Message for NotebookAction {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.NotebookAction"
        }
    }

    /// Represents a workflow action that will run a Data Preparation.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DataPreparationAction {
        /// Output only. The generated BigQuery SQL script that will be executed. For
        /// reference only.
        pub generated_sql: std::string::String,

        /// Output only. The ID of the BigQuery job that executed the SQL in
        /// sql_script. Only set once the job has started to run.
        pub job_id: std::string::String,

        /// The definition for the data preparation.
        pub definition: std::option::Option<
            crate::model::workflow_invocation_action::data_preparation_action::Definition,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DataPreparationAction {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [generated_sql][crate::model::workflow_invocation_action::DataPreparationAction::generated_sql].
        pub fn set_generated_sql<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.generated_sql = v.into();
            self
        }

        /// Sets the value of [job_id][crate::model::workflow_invocation_action::DataPreparationAction::job_id].
        pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.job_id = v.into();
            self
        }

        /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition].
        ///
        /// Note that all the setters affecting `definition` are mutually
        /// exclusive.
        pub fn set_definition<T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::Definition>>>(mut self, v: T) -> Self
        {
            self.definition = v.into();
            self
        }

        /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
        /// if it holds a `ContentsYaml`, `None` if the field is not set or
        /// holds a different branch.
        pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
            #[allow(unreachable_patterns)]
            self.definition.as_ref().and_then(|v| match v {
                crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
        /// to hold a `ContentsYaml`.
        ///
        /// Note that all the setters affecting `definition` are
        /// mutually exclusive.
        pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.definition = std::option::Option::Some(
                crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(
                    v.into()
                )
            );
            self
        }

        /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
        /// if it holds a `ContentsSql`, `None` if the field is not set or
        /// holds a different branch.
        pub fn contents_sql(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>>{
            #[allow(unreachable_patterns)]
            self.definition.as_ref().and_then(|v| match v {
                crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
        /// to hold a `ContentsSql`.
        ///
        /// Note that all the setters affecting `definition` are
        /// mutually exclusive.
        pub fn set_contents_sql<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>>>(mut self, v: T) -> Self{
            self.definition = std::option::Option::Some(
                crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(
                    v.into()
                )
            );
            self
        }
    }

    impl wkt::message::Message for DataPreparationAction {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction"
        }
    }

    /// Defines additional types related to [DataPreparationAction].
    pub mod data_preparation_action {
        #[allow(unused_imports)]
        use super::*;

        /// Definition of a SQL Data Preparation
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct ActionSqlDefinition {
            /// The SQL query representing the data preparation steps. Formatted as a
            /// Pipe SQL query statement.
            pub query: std::string::String,

            /// Error table configuration,
            pub error_table: std::option::Option<
                crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable,
            >,

            /// Load configuration.
            pub load_config: std::option::Option<
                crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig,
            >,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl ActionSqlDefinition {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [query][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::query].
            pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
                self.query = v.into();
                self
            }

            /// Sets the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
            pub fn set_error_table<T>(mut self, v: T) -> Self
            where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
            {
                self.error_table = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
            pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
            where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
            {
                self.error_table = v.map(|x| x.into());
                self
            }

            /// Sets the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
            pub fn set_load_config<T>(mut self, v: T) -> Self
            where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
            {
                self.load_config = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
            pub fn set_or_clear_load_config<T>(mut self, v: std::option::Option<T>) -> Self
            where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
            {
                self.load_config = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for ActionSqlDefinition {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition"
            }
        }

        /// Error table information, used to write error data into a BigQuery
        /// table.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct ActionErrorTable {
            /// Error Table target.
            pub target: std::option::Option<crate::model::Target>,

            /// Error table partition expiration in days. Only positive values are
            /// allowed.
            pub retention_days: i32,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl ActionErrorTable {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
            pub fn set_target<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::Target>,
            {
                self.target = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
            pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::Target>,
            {
                self.target = v.map(|x| x.into());
                self
            }

            /// Sets the value of [retention_days][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::retention_days].
            pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
                self.retention_days = v.into();
                self
            }
        }

        impl wkt::message::Message for ActionErrorTable {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionErrorTable"
            }
        }

        /// Simplified load configuration for actions
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct ActionLoadConfig {

            /// Load mode
            pub mode: std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl ActionLoadConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode].
            ///
            /// Note that all the setters affecting `mode` are mutually
            /// exclusive.
            pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode>>>(mut self, v: T) -> Self
            {
                self.mode = v.into();
                self
            }

            /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// if it holds a `Replace`, `None` if the field is not set or
            /// holds a different branch.
            pub fn replace(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
                #[allow(unreachable_patterns)]
                self.mode.as_ref().and_then(|v| match v {
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(v) => std::option::Option::Some(v),
                    _ => std::option::Option::None,
                })
            }

            /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// to hold a `Replace`.
            ///
            /// Note that all the setters affecting `mode` are
            /// mutually exclusive.
            pub fn set_replace<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>>(mut self, v: T) -> Self{
                self.mode = std::option::Option::Some(
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(
                        v.into()
                    )
                );
                self
            }

            /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// if it holds a `Append`, `None` if the field is not set or
            /// holds a different branch.
            pub fn append(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
                #[allow(unreachable_patterns)]
                self.mode.as_ref().and_then(|v| match v {
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(v) => std::option::Option::Some(v),
                    _ => std::option::Option::None,
                })
            }

            /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// to hold a `Append`.
            ///
            /// Note that all the setters affecting `mode` are
            /// mutually exclusive.
            pub fn set_append<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>>(mut self, v: T) -> Self{
                self.mode = std::option::Option::Some(
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(
                        v.into()
                    )
                );
                self
            }

            /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// if it holds a `Maximum`, `None` if the field is not set or
            /// holds a different branch.
            pub fn maximum(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
                #[allow(unreachable_patterns)]
                self.mode.as_ref().and_then(|v| match v {
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(v) => std::option::Option::Some(v),
                    _ => std::option::Option::None,
                })
            }

            /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// to hold a `Maximum`.
            ///
            /// Note that all the setters affecting `mode` are
            /// mutually exclusive.
            pub fn set_maximum<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>>(mut self, v: T) -> Self{
                self.mode = std::option::Option::Some(
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(
                        v.into()
                    )
                );
                self
            }

            /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// if it holds a `Unique`, `None` if the field is not set or
            /// holds a different branch.
            pub fn unique(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
                #[allow(unreachable_patterns)]
                self.mode.as_ref().and_then(|v| match v {
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(v) => std::option::Option::Some(v),
                    _ => std::option::Option::None,
                })
            }

            /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
            /// to hold a `Unique`.
            ///
            /// Note that all the setters affecting `mode` are
            /// mutually exclusive.
            pub fn set_unique<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>>(mut self, v: T) -> Self{
                self.mode = std::option::Option::Some(
                    crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(
                        v.into()
                    )
                );
                self
            }
        }

        impl wkt::message::Message for ActionLoadConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig"
            }
        }

        /// Defines additional types related to [ActionLoadConfig].
        pub mod action_load_config {
            #[allow(unused_imports)]
            use super::*;

            /// Load mode
            #[derive(Clone, Debug, PartialEq)]
            #[non_exhaustive]
            pub enum Mode {
                /// Replace destination table
                Replace(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
                /// Append into destination table
                Append(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
                /// Insert records where the value exceeds the previous maximum value for
                /// a column in the destination table
                Maximum(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
                /// Insert records where the value of a column is not already present in
                /// the destination table
                Unique(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
            }
        }

        /// Simple load definition
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct ActionSimpleLoadMode {
            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl ActionSimpleLoadMode {
            pub fn new() -> Self {
                std::default::Default::default()
            }
        }

        impl wkt::message::Message for ActionSimpleLoadMode {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode"
            }
        }

        /// Load definition for incremental load modes
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct ActionIncrementalLoadMode {
            /// Column name for incremental load modes
            pub column: std::string::String,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl ActionIncrementalLoadMode {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [column][crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode::column].
            pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
                self.column = v.into();
                self
            }
        }

        impl wkt::message::Message for ActionIncrementalLoadMode {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode"
            }
        }

        /// The definition for the data preparation.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Definition {
            /// Output only. YAML representing the contents of the data preparation.
            /// Can be used to show the customer what the input was to their workflow.
            ContentsYaml(std::string::String),
            /// SQL definition for a Data Preparation. Contains a SQL query and
            /// additional context information.
            ContentsSql(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>),
        }
    }

    /// Represents the current state of a workflow invocation action.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The action has not yet been considered for invocation.
        Pending,
        /// The action is currently running.
        Running,
        /// Execution of the action was skipped because upstream dependencies did not
        /// all complete successfully. A terminal state.
        Skipped,
        /// Execution of the action was disabled as per the configuration of the
        /// corresponding compilation result action. A terminal state.
        Disabled,
        /// The action succeeded. A terminal state.
        Succeeded,
        /// The action was cancelled. A terminal state.
        Cancelled,
        /// The action failed. A terminal state.
        Failed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Pending => std::option::Option::Some(0),
                Self::Running => std::option::Option::Some(1),
                Self::Skipped => std::option::Option::Some(2),
                Self::Disabled => std::option::Option::Some(3),
                Self::Succeeded => std::option::Option::Some(4),
                Self::Cancelled => std::option::Option::Some(5),
                Self::Failed => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Pending => std::option::Option::Some("PENDING"),
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::Skipped => std::option::Option::Some("SKIPPED"),
                Self::Disabled => std::option::Option::Some("DISABLED"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Cancelled => std::option::Option::Some("CANCELLED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Pending,
                1 => Self::Running,
                2 => Self::Skipped,
                3 => Self::Disabled,
                4 => Self::Succeeded,
                5 => Self::Cancelled,
                6 => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "PENDING" => Self::Pending,
                "RUNNING" => Self::Running,
                "SKIPPED" => Self::Skipped,
                "DISABLED" => Self::Disabled,
                "SUCCEEDED" => Self::Succeeded,
                "CANCELLED" => Self::Cancelled,
                "FAILED" => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Pending => serializer.serialize_i32(0),
                Self::Running => serializer.serialize_i32(1),
                Self::Skipped => serializer.serialize_i32(2),
                Self::Disabled => serializer.serialize_i32(3),
                Self::Succeeded => serializer.serialize_i32(4),
                Self::Cancelled => serializer.serialize_i32(5),
                Self::Failed => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.dataform.v1.WorkflowInvocationAction.State",
            ))
        }
    }

    /// The action's details.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Action {
        /// Output only. The workflow action's bigquery action details.
        BigqueryAction(std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>),
        /// Output only. The workflow action's notebook action details.
        NotebookAction(std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>),
        /// Output only. The workflow action's data preparation action details.
        DataPreparationAction(
            std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
        ),
    }
}

/// `QueryWorkflowInvocationActions` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryWorkflowInvocationActionsRequest {
    /// Required. The workflow invocation's name.
    pub name: std::string::String,

    /// Optional. Maximum number of workflow invocations to return. The server may
    /// return fewer items than requested. If unspecified, the server will pick an
    /// appropriate default.
    pub page_size: i32,

    /// Optional. Page token received from a previous
    /// `QueryWorkflowInvocationActions` call. Provide this to retrieve the
    /// subsequent page.
    ///
    /// When paginating, all other parameters provided to
    /// `QueryWorkflowInvocationActions`, with the exception of `page_size`, must
    /// match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryWorkflowInvocationActionsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::QueryWorkflowInvocationActionsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::QueryWorkflowInvocationActionsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::QueryWorkflowInvocationActionsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryWorkflowInvocationActionsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsRequest"
    }
}

/// `QueryWorkflowInvocationActions` response message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryWorkflowInvocationActionsResponse {
    /// List of workflow invocation actions.
    pub workflow_invocation_actions: std::vec::Vec<crate::model::WorkflowInvocationAction>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryWorkflowInvocationActionsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workflow_invocation_actions][crate::model::QueryWorkflowInvocationActionsResponse::workflow_invocation_actions].
    pub fn set_workflow_invocation_actions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::WorkflowInvocationAction>,
    {
        use std::iter::Iterator;
        self.workflow_invocation_actions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::QueryWorkflowInvocationActionsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryWorkflowInvocationActionsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for QueryWorkflowInvocationActionsResponse {
    type PageItem = crate::model::WorkflowInvocationAction;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.workflow_invocation_actions
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Config for all repositories in a given project and location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Config {
    /// Identifier. The config name.
    pub name: std::string::String,

    /// Optional. The default KMS key that is used if no encryption key is provided
    /// when a repository is created.
    pub default_kms_key_name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Config {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Config::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [default_kms_key_name][crate::model::Config::default_kms_key_name].
    pub fn set_default_kms_key_name<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.default_kms_key_name = v.into();
        self
    }
}

impl wkt::message::Message for Config {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.Config"
    }
}

/// `GetConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetConfigRequest {
    /// Required. The config name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.GetConfigRequest"
    }
}

/// `UpdateConfig` request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateConfigRequest {
    /// Required. The config to update.
    pub config: std::option::Option<crate::model::Config>,

    /// Optional. Specifies the fields to be updated in the config.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [config][crate::model::UpdateConfigRequest::config].
    pub fn set_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Config>,
    {
        self.config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [config][crate::model::UpdateConfigRequest::config].
    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Config>,
    {
        self.config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.dataform.v1.UpdateConfigRequest"
    }
}
